RequestWithPayload

public struct RequestWithPayload<HTTPBody> where HTTPBody : Encodable
extension RequestWithPayload: URLRequestProvider

Request structure with a encodable http body. Used for POST and DELETE requests.

  • url

    The url provider

    Declaration

    Swift

    public let url: URLProvider
  • HTTP Method for this request

    Declaration

    Swift

    public let method: HTTPMethod
  • Headers to be added for this request

    Declaration

    Swift

    public let headers: Headers?
  • The encodable parameters that needs to be sent with the request body

    Declaration

    Swift

    public let httpBody: HTTPBody?
  • Initializer to construct a request object

    Declaration

    Swift

    public init(url: URLProvider, method: HTTPMethod, headers: Headers? = nil, httpBody: HTTPBody? = nil)

    Parameters

    url

    The url provider

    method

    HTTP Method for this request

    headers

    Headers to be added for this request

    httpBody

    The encodable parameters that needs to be sent with the request body

  • Declaration

    Swift

    public func urlRequest() throws -> URLRequest