Merge pull request #279 from TouchInstinct/fix/fix_headers
fix incorrect header handling
This commit is contained in:
commit
4e7d4356fe
|
|
@ -1,12 +1,12 @@
|
|||
open class HeadersParameterEncoding: BaseUrlParameterEncoding, ParameterEncoding {
|
||||
open class HeadersParameterEncoding {
|
||||
public let sequenceSeparator: String
|
||||
|
||||
public init(sequenceSeparator: String = ";") {
|
||||
self.sequenceSeparator = sequenceSeparator
|
||||
}
|
||||
|
||||
open func encode(parameters: [String: Parameter<LocationHeader>]) -> [String: String] {
|
||||
Dictionary(encode(parameters: parameters)) {
|
||||
open func encode(parameters: [KeyValueTuple<String, String>]) -> [String: String] {
|
||||
Dictionary(parameters) {
|
||||
$0 + sequenceSeparator + $1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
protocol ParameterEncoding {
|
||||
associatedtype Location: ParameterLocation
|
||||
associatedtype Result
|
||||
|
||||
func encode(parameters: [String: Parameter<Location>]) -> Result
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ public struct Request<Content: BodyContent> {
|
|||
public var requestBodyContent: Content
|
||||
public var queryParameters: [String: Parameter<LocationQuery>]
|
||||
public var pathParameters: [String: Parameter<LocationPath>]
|
||||
public var headerParameters: [String: Parameter<LocationHeader>]
|
||||
public var headerParameters: HTTPHeaders?
|
||||
public var cookieParameters: [String: Parameter<LocationCookie>]
|
||||
public var acceptableStatusCodes: Set<Int>
|
||||
public var serverOverride: Server?
|
||||
|
|
@ -22,7 +22,7 @@ public struct Request<Content: BodyContent> {
|
|||
requestBodyContent: Content,
|
||||
queryParameters: [String: Parameter<LocationQuery>] = [:],
|
||||
pathParameters: [String: Parameter<LocationPath>] = [:],
|
||||
headerParameters: [String: Parameter<LocationHeader>] = [:],
|
||||
headerParameters: HTTPHeaders? = nil,
|
||||
cookieParameters: [String: Parameter<LocationCookie>] = [:],
|
||||
acceptableStatusCodes: Set<Int> = [200],
|
||||
serverOverride: Server? = nil,
|
||||
|
|
|
|||
Loading…
Reference in New Issue