# RequestBuilder

    public class RequestBuilder

RequestBuilder is an IPFS command request builder

Show on GitHub

- `with(argument:)`

  Adds an argument to the request

  Seealso

  IPFS API Doc

  #### Declaration

  Swift

      public func with(argument: String) -> RequestBuilder

  #### Parameters

  `argument` | The argument to add

  #### Return Value

  This instance of RequestBuilder

  Show on GitHub
- `with(option:value:)`

  Adds an option to the request

  Seealso

  IPFS API Doc

  #### Declaration

  Swift

      public func with(option: String, value: RequestOption) -> RequestBuilder

  #### Parameters

  `option` | The name of the option to add
  `value` | The value of the option to add

  #### Return Value

  This instance of RequestBuilder

  Show on GitHub
- `with(body:)`

  Adds a body to the request

  Seealso

  IPFS API Doc

  #### Declaration

  Swift

      public func with(body: RequestBody) -> RequestBuilder

  #### Parameters

  `body` | The value of body to add

  #### Return Value

  This instance of RequestBuilder

  Show on GitHub
- `with(header:value:)`

  Adds a header to the request

  Seealso

  IPFS API Doc

  #### Declaration

  Swift

      public func with(header: String, value: String) -> RequestBuilder

  #### Parameters

  `header` | The key of the header to add
  `value` | The value of the header to add

  #### Return Value

  This instance of RequestBuilder

  Show on GitHub
- `send()`

  Sends the request to the underlying go-ipfs node and returns an InputStream

  Throws

  `RequestBuilderError`: If sending the request failed

  Seealso

  IPFS API Doc

  #### Declaration

  Swift

      public func send() throws -> InputStream

  #### Return Value

  An InputStream from which to read the response

  Show on GitHub
- `sendToBytes()`

  Sends the request to the underlying go-ipfs node and returns a byte array

  Throws

  `RequestBuilderError`: If sending the request failed

  Seealso

  IPFS API Doc

  #### Declaration

  Swift

      public func sendToBytes() throws -> Data?

  #### Return Value

  A Data object containing the response

  Show on GitHub
- `sendToDict()`

  Sends the request to the underlying go-ipfs node and returns a dict

  Throws

  `RequestBuilderError`: If sending the request or converting the response failed

  Seealso

  IPFS API Doc

  #### Declaration

  Swift

      public func sendToDict() throws -> [String : Any]?

  #### Return Value

  A dict containing the response

  Show on GitHub

© 2022 . All rights reserved. (Last updated: 2022-12-05)

Generated by jazzy ♪♫ v0.14.3, a Realm project.