Inherits from NSObject
Declared in RKParamsAttachment.h
RKParamsAttachment.m

Overview

Models an individual part of a multi-part MIME document. These attachments are stacked together within the RKParams document to allow for uploading files via HTTP

Tasks

  •   name

    The parameter name of this attachment in the multi-part document

    property
  •   fileName

    The name of the attached file in the MIME stream Defaults to the name of the file attached or nil if there is not one.

    property
  •   MIMEType

    The MIME type of the attached file in the MIME stream. MIME Type will be auto-detected from the file extension of the attached file.

    property
  •   MIMEBoundary

    The MIME boundary string

    property
  • – initWithName:value:

    Initialize a new attachment with a given parameter name and a value

  • – initWithName:data:

    Initialize a new attachment with a given parameter name and the data stored in an NSData object

  • – initWithName:file:

    Initialize a new attachment with a given parameter name and the data stored on disk at the given file path

  • – open

    Open the attachment stream to begin reading. This will generate a MIME header and prepare the attachment for writing to an RKParams stream

  • – length

    The length of the entire attachment (including the MIME Header and the body)

  • – read:maxLength:

    Read the attachment body in a streaming fashion

Properties

MIMEBoundary

The MIME boundary string

@property (nonatomic, readonly) NSString *MIMEBoundary

Declared In

RKParamsAttachment.h

MIMEType

The MIME type of the attached file in the MIME stream. MIME Type will be auto-detected from the file extension of the attached file.

@property (nonatomic, retain) NSString *MIMEType

Discussion

Defaults to nil

Declared In

RKParamsAttachment.h

fileName

The name of the attached file in the MIME stream Defaults to the name of the file attached or nil if there is not one.

@property (nonatomic, retain) NSString *fileName

Declared In

RKParamsAttachment.h

name

The parameter name of this attachment in the multi-part document

@property (nonatomic, retain) NSString *name

Declared In

RKParamsAttachment.h

Instance Methods

initWithName:data:

Initialize a new attachment with a given parameter name and the data stored in an NSData object

- (id)initWithName:(NSString *)name data:(NSData *)data

Declared In

RKParamsAttachment.h

initWithName:file:

Initialize a new attachment with a given parameter name and the data stored on disk at the given file path

- (id)initWithName:(NSString *)name file:(NSString *)filePath

Declared In

RKParamsAttachment.h

initWithName:value:

Initialize a new attachment with a given parameter name and a value

- (id)initWithName:(NSString *)name value:(id<NSObject>)value

Declared In

RKParamsAttachment.h

length

The length of the entire attachment (including the MIME Header and the body)

- (NSUInteger)length

Declared In

RKParamsAttachment.h

open

Open the attachment stream to begin reading. This will generate a MIME header and prepare the attachment for writing to an RKParams stream

- (void)open

Declared In

RKParamsAttachment.h

read:maxLength:

Read the attachment body in a streaming fashion

- (NSUInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len

Declared In

RKParamsAttachment.h