FoundationExtension
FoundationExtension is common Foundation/UIKit/Cocoa shortcuts and snippets collection.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSAURLRequestHTTPBodyMultiPartFormPostFormatter Class Reference

Multipart Form POST data formatter for NSMutableURLRequest. More...

#import <NSURLRequest.h>

Inheritance diagram for NSAURLRequestHTTPBodyMultiPartFormPostFormatter:

Instance Methods

(instancetype) - initWithEncoding:
 Initialize formatter with default encoding. More...
 
(void) - appendBodyDataToFieldName:text:
 Appends text data to field name with default encoding. More...
 
(void) - appendBodyDataToFieldName:text:encoding:
 Appends text data to field name with specified encoding. More...
 
(void) - appendBodyDataToFieldName:data:
 Appends bytes data to field name. More...
 
(void) - appendBodyDataToFieldName:fileName:data:
 Appends bytes data to field name with given filename. More...
 
(void) - appendBodyDataEndian
 Appends body data endian. More...
 
(NSData *) - HTTPBody
 Returns body data. More...
 

Protected Attributes

NSMutableData * _body
 
NSStringEncoding _encoding
 

Detailed Description

Multipart Form POST data formatter for NSMutableURLRequest.

Method Documentation

- (void) appendBodyDataEndian

Appends body data endian.

This should be called once after last data is appended.

- (void) appendBodyDataToFieldName: (NSString *)  fieldName
data: (NSData *)  data 

Appends bytes data to field name.

Parameters
fieldNameField name for data.
dataData to be appended.
- (void) appendBodyDataToFieldName: (NSString *)  fieldName
fileName: (NSString *)  fileName
data: (NSData *)  data 

Appends bytes data to field name with given filename.

Parameters
fieldNameField name for data.
fileNameFile name for data.
dataData to be appended.
- (void) appendBodyDataToFieldName: (NSString *)  fieldName
text: (NSString *)  textData 

Appends text data to field name with default encoding.

Parameters
fieldNameField name for data.
textDataText data to be appended.
- (void) appendBodyDataToFieldName: (NSString *)  fieldName
text: (NSString *)  textData
encoding: (NSStringEncoding)  encoding 

Appends text data to field name with specified encoding.

Parameters
fieldNameField name for data.
textDataText data to be appended.
encodingText data encoding.
- (NSData *) HTTPBody

Returns body data.

Returns
Returns body data.

This should be called after -appendBodyDataEndian is called.

- (instancetype) initWithEncoding: (NSStringEncoding)  encoding

Initialize formatter with default encoding.

Parameters
encodingDefault encoding for formatter

Member Data Documentation

- (NSMutableData*) _body
protected
- (NSStringEncoding) _encoding
protected

The documentation for this class was generated from the following file: