ObjFW
|
A class for storing and performing HTTP requests. More...
#import <OFHTTPRequest.h>
Public Member Functions | |
(id) | - initWithURL: |
Initializes an already allocated OFHTTPRequest with the specified URL. | |
(void) | - setURL: |
Sets the URL of the HTTP request. | |
(OFURL *) | - URL |
Returns the URL of the HTTP request. | |
(void) | - setRequestType: |
Sets the request type of the HTTP request. | |
(of_http_request_type_t) | - requestType |
Returns the request type of the HTTP request. | |
(void) | - setQueryString: |
Sets the query string of the HTTP request. | |
(OFString *) | - queryString |
Returns the query string of the HTTP request. | |
(void) | - setHeaders: |
Sets a dictionary with headers for the HTTP request. | |
(OFDictionary *) | - headers |
Retrusn a dictionary with headers for the HTTP request. | |
(void) | - setRedirectsFromHTTPSToHTTPAllowed: |
Sets whether redirects from HTTPS to HTTP are allowed. | |
(BOOL) | - redirectsFromHTTPSToHTTPAllowed |
Returns whether redirects from HTTPS to HTTP will be allowed. | |
(void) | - setDelegate: |
Sets the delegate of the HTTP request. | |
(id< OFHTTPRequestDelegate >) | - delegate |
Returns the delegate of the HTTP reqeust. | |
(void) | - setStoresData: |
Sets whether an OFDataArray with the data should be created. | |
(BOOL) | - storesData |
Returns whether an OFDataArray with the date should be created. | |
(OFHTTPRequestResult *) | - perform |
Performs the HTTP request and returns an OFHTTPRequestResult. | |
(OFHTTPRequestResult *) | - performWithRedirects: |
Performs the HTTP request and returns an OFHTTPRequestResult. | |
Static Public Member Functions | |
(id) | + request |
Creates a new OFHTTPRequest. | |
(id) | + requestWithURL: |
Creates a new OFHTTPRequest with the specified URL. |
A class for storing and performing HTTP requests.
- (id <OFHTTPRequestDelegate>) delegate |
Returns the delegate of the HTTP reqeust.
- (OFDictionary*) headers |
Retrusn a dictionary with headers for the HTTP request.
- (id) initWithURL: | (OFURL*) | URL |
Initializes an already allocated OFHTTPRequest with the specified URL.
URL | The URL for the request |
- (OFHTTPRequestResult *) perform |
Performs the HTTP request and returns an OFHTTPRequestResult.
- (OFHTTPRequestResult *) performWithRedirects: | (size_t) | redirects |
Performs the HTTP request and returns an OFHTTPRequestResult.
redirects | The maximum number of redirects after which no further attempt is done to follow the redirect, but instead the redirect is returned as an OFHTTPRequest |
- (OFString*) queryString |
Returns the query string of the HTTP request.
- (BOOL) redirectsFromHTTPSToHTTPAllowed |
Returns whether redirects from HTTPS to HTTP will be allowed.
+ (id) request |
Creates a new OFHTTPRequest.
- (of_http_request_type_t) requestType |
Returns the request type of the HTTP request.
+ (id) requestWithURL: | (OFURL*) | URL |
Creates a new OFHTTPRequest with the specified URL.
URL | The URL for the request |
- (void) setDelegate: | (id <OFHTTPRequestDelegate>) | delegate |
Sets the delegate of the HTTP request.
delegate | The delegate of the HTTP request |
- (void) setHeaders: | (OFDictionary*) | headers |
Sets a dictionary with headers for the HTTP request.
headers | A dictionary with headers for the HTTP request |
- (void) setQueryString: | (OFString*) | queryString |
Sets the query string of the HTTP request.
queryString | The query string of the HTTP request |
- (void) setRedirectsFromHTTPSToHTTPAllowed: | (BOOL) | allowed |
Sets whether redirects from HTTPS to HTTP are allowed.
allowed | Whether redirects from HTTPS to HTTP are allowed |
- (void) setRequestType: | (of_http_request_type_t) | requestType |
Sets the request type of the HTTP request.
requestType | The request type of the HTTP request |
- (void) setStoresData: | (BOOL) | storesData |
Sets whether an OFDataArray with the data should be created.
Setting this to NO is only useful if you are using the delegate to handle the data.
storesData | Whether to store the data in an OFDataArray |
- (void) setURL: | (OFURL*) | URL |
Sets the URL of the HTTP request.
URL | The URL of the HTTP request |
- (BOOL) storesData |
Returns whether an OFDataArray with the date should be created.
- (OFURL*) URL |
Returns the URL of the HTTP request.