Code Monkey home page Code Monkey logo

restframework's People

Contributors

ivasic avatar pesicvladica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

restframework's Issues

ios 4 support

Did this framework support ios4?
I have a concern, since you are using objC block e.g. completion:^(RFResponse *response)

Typo in github documentation

I think that instead of variable r should be response

//now execute this request and fetch the response in a block
[RFService execRequest:r completion:^(RFResponse *response) {
  NSLog(@"%@", r); //print out full response
  NSLog(@"%@", r.dataValue); //dataValue is received response as NSData (e.g. you can do [r.dataValue objectFromJSONData])
}];

and in the second code block example, it should be RFRequestMethodPostinstead of RFRequestMethodGet

RESTframework & ARC

Hello,

I see you're deallocing & releasing your objects manually.

Does it means I have to deactivate ARC on my project to use your framework ? Or could i simply modify your sources to make it work with ARC ?

Thanks ;)

Keep it going, your framework really helped me understand the way of dealing with REST services !

Post json

Why did you comment out line 348 in file RFRequest.m

        /*case RESTRequestBodyTypeJSON:
         return @"application/json";*/

How do I post json format?

Post file and extra parameters

Hi Ivan!

Thank you for the framework.

How can I add upload a file and additional parameters to the same request?

I've got the following code:

RFRequest *r = [RFRequest requestWithURL:[NSURL URLWithString:BASE_URL] type:RFRequestMethodPost bodyContentType:RFRequestBodyTypeMultiPartFormData resourcePathComponents:token, @"resource", nil];

NSString  *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/tempImage.jpg"];    
[r addData:[NSData dataWithContentsOfFile:jpgPath] withContentType:@"image/jpeg" forKey:@"image.jpg"];

[r addParam:@"Some String" forKey:@"resource[string_value]"];
[r addParam:@"2012-06-10" forKey:@"resource[another_string_value]"];

Only one parameter is sent to the Rails API.

What am I missing?

Thanks

/ Ola

Exception handling

Can you post some examples how to handle exceptions?

let say you do
[RFService execRequest:r completion:^(RFResponse *response) {

but server is not available or the document is not found (404)

Can't upload a file

Hi,
I'm trying to upload a file from my iPhone ios 6.
In wireshark, I see that the data is missing, I only see Content-Disposition and Content-Type but no data.
Content-Disposition: form-data; name="file"; filename="mypic.jpeg"\r\n
Content-Type: image/jpeg\r\n\r\n
and after that - NOTHING

Here is my code:
RFRequest* r = [RFRequest requestWithURL:[NSURL URLWithString:url] type:RFRequestMethodPost bodyContentType:RFRequestBodyTypeMultiPartFormData resourcePathComponents:nil];

//add files...
NSData *data = UIImageJPEGRepresentation(self.selectedImage, 1.0);
[r addData:data withContentType:@"image/jpeg" forKey:@"mypic.jpeg"];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.