RequestBuilder
public class RequestBuilder
RequestBuilder is an IPFS command request builder
-
Adds an argument to the request
Seealso
IPFS API DocDeclaration
Swift
public func with(argument: String) -> RequestBuilderParameters
argumentThe argument to add
Return Value
This instance of RequestBuilder
-
Adds an option to the request
Seealso
IPFS API DocDeclaration
Swift
public func with(option: String, value: RequestOption) -> RequestBuilderParameters
optionThe name of the option to add
valueThe value of the option to add
Return Value
This instance of RequestBuilder
-
Adds a body to the request
Seealso
IPFS API DocDeclaration
Swift
public func with(body: RequestBody) -> RequestBuilderParameters
bodyThe value of body to add
Return Value
This instance of RequestBuilder
-
Adds a header to the request
Seealso
IPFS API DocDeclaration
Swift
public func with(header: String, value: String) -> RequestBuilderParameters
headerThe key of the header to add
valueThe value of the header to add
Return Value
This instance of RequestBuilder
-
Sends the request to the underlying go-ipfs node and returns an InputStream
Throws
RequestBuilderError: If sending the request failedSeealso
IPFS API DocDeclaration
Swift
public func send() throws -> InputStreamReturn Value
An InputStream from which to read the response
-
Sends the request to the underlying go-ipfs node and returns a byte array
Throws
RequestBuilderError: If sending the request failedSeealso
IPFS API DocDeclaration
Swift
public func sendToBytes() throws -> Data?Return Value
A Data object containing the response
-
Sends the request to the underlying go-ipfs node and returns a dict
Throws
RequestBuilderError: If sending the request or converting the response failedSeealso
IPFS API DocDeclaration
Swift
public func sendToDict() throws -> [String : Any]?Return Value
A dict containing the response
View on GitHub
RequestBuilder Class Reference