Skip to content

Commit

Permalink
Set Content-Type correctly for Jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Butkiewicz committed Oct 11, 2016
1 parent 3291e26 commit 70306ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/APIClient.swift
Original file line number Diff line number Diff line change
@@ -98,8 +98,11 @@ internal final class APIClient: NSObject {

_ = headers.map { request.addValue($0.value, forHTTPHeaderField: $0.key) }

if method == .POST {
request.addValue("Content-Type: application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type")
}

if let body = body {
request.addValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type")
request.httpBody = body
} else {
var components = URLComponents(url: url, resolvingAgainstBaseURL: false)

0 comments on commit 70306ec

Please sign in to comment.