OSWebRequest

Superclass:
NSObject
Declared In:

Introduction

Web requests class



Methods

-postFile:withName::withParams:toURL:withHandler:

Send a file to a server using multipart/form-data

-useCredentials:withPassword:

Send a file to a server using multipart/form-data


postFile:withName::withParams:toURL:withHandler:


Send a file to a server using multipart/form-data

-(void) useEncoding:(NSStringEncoding)enc;     -(void)useCredentials:(NSString*)user withPassword:(NSString*)password;    -(void)cancelRequest;    -(void)get:(NSString*)url withHandler:(OSRequestHandler)handler;    -(void)post:(NSString*)data toURL:(NSString*)url withHandler:(OSRequestHandler)handler;    -(void)post2:(NSDictionary*)object toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;    -(void)postJson:(NSString*)data toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;    -(void)putJson:(NSString*)data toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;    - (void)postFile:(NSData*)fileData withName:(NSString*)fileName 
        withParams:(NSDictionary *)requestData toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;   @@end
Parameters
enc

Encoding. Examples: NSISOLatin1StringEncoding or NSUTF8StringEncoding or NSASCIIStringEncoding.

url

URL to download

Destination URL

Destination URL

Destination URL

Destination URL

handler

this method will be called at the end of request.

this method will be called at the end of request.

this method will be called at the end of request.

this method will be called at the end of request.

this method will be called at the end of request.

data

Data to send

NSDictionary object with the ky/value pairs to send as the http body.

Data to send

Data to send

Discussion

Use this method to send data using POST http verb to a server. Only when Content-type must be Json data.

See Also


useCredentials:withPassword:


Send a file to a server using multipart/form-data

-(void) useEncoding:(NSStringEncoding)enc;     -(void)useCredentials:(NSString*)user withPassword:(NSString*)password;    -(void)cancelRequest;    -(void)get:(NSString*)url withHandler:(OSRequestHandler)handler;    -(void)post:(NSString*)data toURL:(NSString*)url withHandler:(OSRequestHandler)handler;    -(void)post2:(NSDictionary*)object toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;    -(void)postJson:(NSString*)data toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;    -(void)putJson:(NSString*)data toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;    - (void)postFile:(NSData*)fileData withName:(NSString*)fileName 
        withParams:(NSDictionary *)requestData toURL:(NSString*)u 
        withHandler:(OSRequestHandler)handler;   @@end
Parameters
enc

Encoding. Examples: NSISOLatin1StringEncoding or NSUTF8StringEncoding or NSASCIIStringEncoding.

url

URL to download

Destination URL

Destination URL

Destination URL

Destination URL

handler

this method will be called at the end of request.

this method will be called at the end of request.

this method will be called at the end of request.

this method will be called at the end of request.

this method will be called at the end of request.

data

Data to send

NSDictionary object with the ky/value pairs to send as the http body.

Data to send

Data to send

Discussion

Use this method to send data using POST http verb to a server. Only when Content-type must be Json data.

See Also