BaseResource
@objc
public class BaseResource : NSObject
A wrapper over NSMutableURLRequest, only containing a request with the Server URL of the WebService
Use any of the HTTPMethod modifiers like .get() or .post() to get a NetworkResource from this.
-
Sets the HTTP Method of the request to GET and returns a NetworkResource.
The path relative to the server URL should be passed as the argument. The first forward slash is not required.
For example: To set path server.com/api, just pass in argument
api
Declaration
Swift
func get(_ path: String) -> NetworkResource
Parameters
path
String (The first forward slash is not required)
Return Value
NetworkResource
-
Sets the HTTP Method of the request to POST and returns a NetworkResource.
The path relative to the server URL should be passed as the argument. The first forward slash is not required.
For example: To set path server.com/api, just pass in argument
api
Declaration
Swift
func post(_ path: String) -> NetworkResourceWithBody
Parameters
path
String (The first forward slash is not required)
Return Value
NetworkResourceWithBody
-
Sets the HTTP Method of the request to PUT and returns a NetworkResource.
The path relative to the server URL should be passed as the argument. The first forward slash is not required.
For example: To set path server.com/api, just pass in argument
api
Declaration
Swift
func put(_ path: String) -> NetworkResourceWithBody
Parameters
path
String (The first forward slash is not required)
Return Value
NetworkResourceWithBody
-
Sets the HTTP Method of the request to DELETE and returns a NetworkResource.
The path relative to the server URL should be passed as the argument. The first forward slash is not required.
For example: To set path server.com/api, just pass in argument
api
Declaration
Swift
func delete(_ path: String) -> NetworkResourceWithBody
Parameters
path
String (The first forward slash is not required)
Return Value
NetworkResourceWithBody