From c5afc0b4310fbd5a9811b6261f31ef7249861ef1 Mon Sep 17 00:00:00 2001 From: Patrick Butkiewicz Date: Wed, 12 Oct 2016 01:54:24 -0400 Subject: [PATCH] Pass parameters through the URL instead of in the HTTP body --- Sources/APIClient.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/APIClient.swift b/Sources/APIClient.swift index 96832aa..a0232d8 100644 --- a/Sources/APIClient.swift +++ b/Sources/APIClient.swift @@ -99,7 +99,7 @@ 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") + request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type") } if let body = body { @@ -115,7 +115,7 @@ internal final class APIClient: NSObject { } components?.queryItems = queryItems - request.httpBody = components?.percentEncodedQuery?.data(using: String.Encoding.utf8) + request.url = components?.url } return request