-
Notifications
You must be signed in to change notification settings - Fork 1
HTTPHeaders
An order-preserving and case-insensitive representation of HTTP headers.
public struct HTTPHeaders
Collection
, CustomStringConvertible
, ExpressibleByArrayLiteral
, ExpressibleByDictionaryLiteral
, Sequence
Creates an empty instance.
public init()
Creates an instance from an array of HTTPHeader
s. Duplicate case-insensitive names are collapsed into the last
name and value encountered.
public init(_ headers: [HTTPHeader])
Creates an instance from a [String: String]
. Duplicate case-insensitive names are collapsed into the last name
and value encountered.
public init(_ dictionary: [String: String])
public init(dictionaryLiteral elements: (String, String))
public init(arrayLiteral elements: HTTPHeader)
The dictionary representation of all headers.
var dictionary: [String: String]
This representation does not preserve the current order of the instance.
var startIndex: Int
var endIndex: Int
var description: String
The default set of HTTPHeaders
used by Alamofire. Includes Accept-Encoding
, Accept-Language
, and
User-Agent
.
let `default`: HTTPHeaders = [.defaultAcceptEncoding,
.defaultAcceptLanguage,
.defaultUserAgent]
Case-insensitively updates or appends an HTTPHeader
into the instance using the provided name
and value
.
public mutating func add(name: String, value: String)
- name: The
HTTPHeader
name. - value: The `HTTPHeader value.
Case-insensitively updates or appends the provided HTTPHeader
into the instance.
public mutating func add(_ header: HTTPHeader)
- header: The
HTTPHeader
to update or append.
Case-insensitively updates or appends an HTTPHeader
into the instance using the provided name
and value
.
public mutating func update(name: String, value: String)
- name: The
HTTPHeader
name. - value: The `HTTPHeader value.
Case-insensitively updates or appends the provided HTTPHeader
into the instance.
public mutating func update(_ header: HTTPHeader)
- header: The
HTTPHeader
to update or append.
Case-insensitively removes an HTTPHeader
, if it exists, from the instance.
public mutating func remove(name: String)
- name: The name of the
HTTPHeader
to remove.
Sort the current instance by header name.
public mutating func sort()
Returns an instance sorted by header name.
public func sorted() -> HTTPHeaders
A copy of the current instance sorted by name.
Case-insensitively find a header's value by name.
public func value(for name: String) -> String?
- name: The name of the header to search for, case-insensitively.
The value of header, if it exists.
public func makeIterator() -> IndexingIterator<[HTTPHeader]>
public func index(after i: Int) -> Int
Generated at 2020-09-24T22:11:06+0000 using swift-doc 1.0.0-beta.4.
Types
- AF
- AFError
- AFError.MultipartEncodingFailureReason
- AFError.ParameterEncoderFailureReason
- AFError.ParameterEncoderFailureReason.RequiredComponent
- AFError.ParameterEncodingFailureReason
- AFError.ResponseSerializationFailureReason
- AFError.ResponseValidationFailureReason
- AFError.ServerTrustFailureReason
- AFError.ServerTrustFailureReason.Output
- AFError.URLRequestValidationFailureReason
- Adapter
- AlamofireExtension
- AlamofireNotifications
- ClosureEventMonitor
- CompositeEventMonitor
- CompositeTrustEvaluator
- ConnectionLostRetryPolicy
- DataRequest
- DataResponse
- DataResponseSerializer
- DecodableResponseSerializer
- DefaultTrustEvaluator
- DisabledEvaluator
- DownloadRequest
- DownloadRequest.Downloadable
- DownloadRequest.Options
- DownloadResponse
- Empty
- GoogleXSSIPreprocessor
- HTTPHeader
- HTTPHeaders
- HTTPMethod
- Interceptor
- JSONEncoding
- JSONParameterEncoder
- JSONResponseSerializer
- MultipartFormData
- NetworkReachabilityManager
- NetworkReachabilityManager.NetworkReachabilityStatus
- NetworkReachabilityManager.NetworkReachabilityStatus.ConnectionType
- PassthroughPreprocessor
- PinnedCertificatesTrustEvaluator
- PublicKeysTrustEvaluator
- Redirector
- Redirector.Behavior
- Request
- Request.State
- ResponseCacher
- ResponseCacher.Behavior
- Retrier
- RetryPolicy
- RetryResult
- RevocationTrustEvaluator
- RevocationTrustEvaluator.Options
- ServerTrustManager
- Session
- SessionDelegate
- StringResponseSerializer
- URLEncodedFormEncoder
- URLEncodedFormEncoder.ArrayEncoding
- URLEncodedFormEncoder.BoolEncoding
- URLEncodedFormEncoder.DataEncoding
- URLEncodedFormEncoder.DateEncoding
- URLEncodedFormEncoder.Error
- URLEncodedFormEncoder.KeyEncoding
- URLEncodedFormEncoder.SpaceEncoding
- URLEncodedFormParameterEncoder
- URLEncodedFormParameterEncoder.Destination
- URLEncoding
- URLEncoding.ArrayEncoding
- URLEncoding.BoolEncoding
- URLEncoding.Destination
- UploadRequest
- UploadRequest.Uploadable
Protocols
- AlamofireExtended
- CachedResponseHandler
- DataDecoder
- DataPreprocessor
- DataResponseSerializerProtocol
- DownloadResponseSerializerProtocol
- EmptyResponse
- EventMonitor
- ParameterEncoder
- ParameterEncoding
- RedirectHandler
- RequestAdapter
- RequestDelegate
- RequestInterceptor
- RequestRetrier
- ResponseSerializer
- ServerTrustEvaluating
- URLConvertible
- URLRequestConvertible
- UploadConvertible
- UploadableConvertible