URLRequest
struct URLRequest : ReferenceConvertible, Equatable, Hashable
-
Add a HTTP header.
Declaration
Swift
public mutating func add(value: String, for header: Http.Header)Parameters
valueThe value of the header field.
headerThe 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
contentTypeThe content type.
-
Set the HTTP method of the request.
Declaration
Swift
public mutating func set(method: Http.Method)Parameters
methodThe HTTP method.
View on GitHub
URLRequest Extension Reference