Back to Alamofire

URLRequest

docs/docsets/Alamofire.docset/Contents/Resources/Documents/Extensions/URLRequest.html

5.12.01.4 KB
Original Source

URLRequest

extension URLRequest
extension URLRequest: URLRequestConvertible

`

                headers
                `

Returns allHTTPHeaderFields as HTTPHeaders.

Declaration

Swift

public var headers: HTTPHeaders { get set }

`

                asURLRequest()
                `

Returns self.

Declaration

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.

Declaration

Swift

public init(url: any URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws

Parameters

| url |

The URLConvertible value.

| | method |

The HTTPMethod.

| | headers |

The HTTPHeaders, nil by default.

|

`

                method
                `

Returns the httpMethod as Alamofire’s HTTPMethod type.

Declaration

Swift

public var method: HTTPMethod? { get set }

`

                validate()
                `

Undocumented

Declaration

Swift

public func validate() throws