ObjFW
Public Member Functions | Static Public Member Functions
OFHTTPRequest Class Reference

A class for storing and performing HTTP requests. More...

#import <OFHTTPRequest.h>

Inheritance diagram for OFHTTPRequest:
OFObject <OFObject>

List of all members.

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.

Detailed Description

A class for storing and performing HTTP requests.


Member Function Documentation

- (id <OFHTTPRequestDelegate>) delegate

Returns the delegate of the HTTP reqeust.

Returns:
The delegate of the HTTP request
- (OFDictionary*) headers

Retrusn a dictionary with headers for the HTTP request.

Returns:
A dictionary with headers for the HTTP request.
- (id) initWithURL: (OFURL*)  URL

Initializes an already allocated OFHTTPRequest with the specified URL.

Parameters:
URLThe URL for the request
Returns:
An initialized OFHTTPRequest
- (OFHTTPRequestResult *) perform

Performs the HTTP request and returns an OFHTTPRequestResult.

Returns:
An OFHTTPRequestResult with the result of the HTTP request
- (OFHTTPRequestResult *) performWithRedirects: (size_t)  redirects

Performs the HTTP request and returns an OFHTTPRequestResult.

Parameters:
redirectsThe maximum number of redirects after which no further attempt is done to follow the redirect, but instead the redirect is returned as an OFHTTPRequest
Returns:
An OFHTTPRequestResult with the result of the HTTP request
- (OFString*) queryString

Returns the query string of the HTTP request.

Returns:
The query string of the HTTP request
- (BOOL) redirectsFromHTTPSToHTTPAllowed

Returns whether redirects from HTTPS to HTTP will be allowed.

Returns:
Whether redirects from HTTPS to HTTP will be allowed
+ (id) request

Creates a new OFHTTPRequest.

Returns:
A new, autoreleased OFHTTPRequest
- (of_http_request_type_t) requestType

Returns the request type of the HTTP request.

Returns:
The request type of the HTTP request
+ (id) requestWithURL: (OFURL*)  URL

Creates a new OFHTTPRequest with the specified URL.

Parameters:
URLThe URL for the request
Returns:
A new, autoreleased OFHTTPRequest
- (void) setDelegate: (id <OFHTTPRequestDelegate>)  delegate

Sets the delegate of the HTTP request.

Parameters:
delegateThe delegate of the HTTP request
- (void) setHeaders: (OFDictionary*)  headers

Sets a dictionary with headers for the HTTP request.

Parameters:
headersA dictionary with headers for the HTTP request
- (void) setQueryString: (OFString*)  queryString

Sets the query string of the HTTP request.

Parameters:
queryStringThe query string of the HTTP request
- (void) setRedirectsFromHTTPSToHTTPAllowed: (BOOL)  allowed

Sets whether redirects from HTTPS to HTTP are allowed.

Parameters:
allowedWhether redirects from HTTPS to HTTP are allowed
- (void) setRequestType: (of_http_request_type_t)  requestType

Sets the request type of the HTTP request.

Parameters:
requestTypeThe 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.

Parameters:
storesDataWhether to store the data in an OFDataArray
- (void) setURL: (OFURL*)  URL

Sets the URL of the HTTP request.

Parameters:
URLThe URL of the HTTP request
- (BOOL) storesData

Returns whether an OFDataArray with the date should be created.

Returns:
Whether an OFDataArray with the data should be created
- (OFURL*) URL

Returns the URL of the HTTP request.

Returns:
The URL of the HTTP request

The documentation for this class was generated from the following files:
 All Classes Functions Variables Properties