URLRequest

struct URLRequest : ReferenceConvertible, Equatable, Hashable
  • Add a HTTP header.

    Declaration

    Swift

    public mutating func add(value: String, for header: Http.Header)

    Parameters

    value

    The value of the header field.

    header

    The key of the header field.

  • Set the content type of the HTTP request’s body.

    Declaration

    Swift

    public mutating func set(contentType: Http.ContentType)

    Parameters

    contentType

    The content type.

  • Set the HTTP method of the request.

    Declaration

    Swift

    public mutating func set(method: Http.Method)

    Parameters

    method

    The HTTP method.