docs/docsets/Alamofire.docset/Contents/Resources/Documents/Extensions/URLRequest.html
extension URLRequest
extension URLRequest: URLRequestConvertible
`
headers
`
Returns allHTTPHeaderFields as HTTPHeaders.
Swift
public var headers: HTTPHeaders { get set }
`
asURLRequest()
`
Returns self.
Swift
public func asURLRequest() throws -> URLRequest
`
init(url:method:headers:)
`
Creates an instance with the specified url, method, and headers.
Throws
Any error thrown while converting the URLConvertible to a URL.
Swift
public init(url: any URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws
| url |
The URLConvertible value.
|
| method |
The HTTPMethod.
|
| headers |
The HTTPHeaders, nil by default.
|
`
method
`
Returns the httpMethod as Alamofire’s HTTPMethod type.
Swift
public var method: HTTPMethod? { get set }
`
validate()
`
Undocumented
Swift
public func validate() throws