Skip to content

Change NSURLRequest's HTTPMethod property stub to be readonly #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 80 additions & 17 deletions Foundation/NSURLRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,30 @@ public class NSURLRequest : NSObject, NSSecureCoding, NSCopying, NSMutableCopyin
*/
/*@NSCopying */public var URL: NSURL? { NSUnimplemented() }

/*!
@method cachePolicy
@abstract Returns the cache policy of the receiver.
@result The cache policy of the receiver.
*/
public var cachePolicy: NSURLRequestCachePolicy { get { NSUnimplemented() } }

/*!
@method timeoutInterval
@abstract Returns the timeout interval of the receiver.
@discussion The timeout interval specifies the limit on the idle
interval alloted to a request in the process of loading. The "idle
interval" is defined as the period of time that has passed since the
last instance of load activity occurred for a request that is in the
process of loading. Hence, when an instance of load activity occurs
(e.g. bytes are received from the network for a request), the idle
interval for a request is reset to 0. If the idle interval ever
becomes greater than or equal to the timeout interval, the request
is considered to have timed out. This timeout interval is measured
in seconds.
@result The timeout interval of the receiver.
*/
public var timeoutInterval: NSTimeInterval { get { NSUnimplemented() } }

/*!
@method mainDocumentURL
@abstract The main document URL associated with this load.
Expand All @@ -239,33 +263,65 @@ public class NSURLRequest : NSObject, NSSecureCoding, NSCopying, NSMutableCopyin
/*@NSCopying*/ public var mainDocumentURL: NSURL? { NSUnimplemented() }

/*!
@method HTTPMethod
@abstract Returns the HTTP request method of the receiver.
@result the HTTP request method of the receiver.
@method HTTPMethod
@abstract Returns the HTTP request method of the receiver.
@result the HTTP request method of the receiver.
*/
public var HTTPMethod: String? { get { NSUnimplemented() } set { NSUnimplemented() } }
public var HTTPMethod: String? { get { NSUnimplemented() }}

/*!
@method allHTTPHeaderFields
@abstract Returns a dictionary containing all the HTTP header fields
of the receiver.
@result a dictionary containing all the HTTP header fields of the
receiver.
@method allHTTPHeaderFields
@abstract Returns a dictionary containing all the HTTP header fields
of the receiver.
@result a dictionary containing all the HTTP header fields of the
receiver.
*/
public var allHTTPHeaderFields: [String : String]? { NSUnimplemented() }

/*!
@method valueForHTTPHeaderField:
@abstract Returns the value which corresponds to the given header
field. Note that, in keeping with the HTTP RFC, HTTP header field
names are case-insensitive.
@param field the header field name to use for the lookup
(case-insensitive).
@result the value associated with the given header field, or nil if
there is no value associated with the given header field.
@method valueForHTTPHeaderField:
@abstract Returns the value which corresponds to the given header
field. Note that, in keeping with the HTTP RFC, HTTP header field
names are case-insensitive.
@param field the header field name to use for the lookup
(case-insensitive).
@result the value associated with the given header field, or nil if
there is no value associated with the given header field.
*/
public func valueForHTTPHeaderField(field: String) -> String? { NSUnimplemented() }

/*!
@method HTTPBody
@abstract Returns the request body data of the receiver.
@discussion This data is sent as the message body of the request, as
in done in an HTTP POST request.
@result The request body data of the receiver.
*/
/*@NSCopying*/ public var HTTPBody: NSData? { get { NSUnimplemented() } }

/*!
@method HTTPBodyStream
@abstract Returns the request body stream of the receiver
if any has been set
@discussion The stream is returned for examination only; it is
not safe for the caller to manipulate the stream in any way. Also
note that the HTTPBodyStream and HTTPBody are mutually exclusive - only
one can be set on a given request. Also note that the body stream is
preserved across copies, but is LOST when the request is coded via the
NSCoding protocol
@result The request body stream of the receiver.
*/
public var HTTPBodyStream: NSInputStream? { get { NSUnimplemented() } }

/*!
@method HTTPShouldHandleCookies
@abstract Determine whether default cookie handling will happen for
this request.
@discussion NOTE: This value is not used prior to 10.3
@result YES if cookies will be sent with and set for this request;
otherwise NO.
*/
public var HTTPShouldHandleCookies: Bool { get { NSUnimplemented() } }
}

/*!
Expand Down Expand Up @@ -322,6 +378,13 @@ public class NSMutableURLRequest : NSURLRequest {
*/
/*@NSCopying*/ public override var mainDocumentURL: NSURL? { get { NSUnimplemented() } set { NSUnimplemented() } }

/*!
@method HTTPMethod
@abstract Sets the HTTP request method of the receiver.
@result the HTTP request method of the receiver.
*/
public override var HTTPMethod: String? { get { NSUnimplemented() } set { NSUnimplemented() } }

/*!
@method setValue:forHTTPHeaderField:
@abstract Sets the value of the given HTTP header field.
Expand Down