Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSURLRequestMBS class.

NSURLRequestMBS.allHTTPHeaderFields as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a dictionary of the HTTP header fields associated with the receiver.

NSURLRequestMBS.Constructor(url as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an NSURLRequest with the given URL.
Example
dim r as NSURLRequestMBS
r=new NSURLRequestMBS("http://www.apple.com")

Default values are used for cache policy (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 seconds).
On success, handle property is not zero.

See also:

NSURLRequestMBS.Constructor(url as string, cachePolicy as Integer, timeoutInterval as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 7.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an NSURLRequest with the given URL.
Example
dim r as NSURLRequestMBS
r=new NSURLRequestMBS("http://www.apple.com",NSURLRequestMBS.NSURLRequestReturnCacheDataElseLoad,5.0)

On success, handle property is not zero.

See also:

NSURLRequestMBS.copy as NSURLRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a copy of the request.
Example
// create PUT request
dim m as new NSMutableURLRequestMBS("http://test.test")
m.setHTTPMethod "PUT"

// make a copy
dim r as NSURLRequestMBS = m.copy

// change first request to POST
m.setHTTPMethod "POST"

// and check values
MsgBox m.HTTPMethod+" "+r.HTTPMethod

NSURLRequestMBS.mutableCopy as NSMutableURLRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an editable copy of the request.
Example
// create PUT request
dim m as new NSMutableURLRequestMBS("http://test.test")
m.setHTTPMethod "PUT"

// make a copy
dim r as NSMutableURLRequestMBS = m.mutableCopy

// change request to POST
r.setHTTPMethod "POST"

// and check values
MsgBox m.HTTPMethod+" "+r.HTTPMethod

NSURLRequestMBS.valueForHTTPHeaderField(field as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the value of the specified HTTP header field.
Example
dim m as new NSMutableURLRequestMBS("http://test.test")
m.setValue("just a test", "test")
MsgBox m.valueForHTTPHeaderField("test")

field: The name of the header field whose value is to be returned. In keeping with the HTTP RFC, HTTP header field names are case-insensitive.

Returns the value associated with the header field field, or "" if there is no corresponding header field.

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...