From 5a7c618a3bd96d200231a70f48141b0bf33afcee Mon Sep 17 00:00:00 2001 From: Casper Rasmussen Date: Mon, 20 Feb 2017 10:37:47 +0000 Subject: [PATCH 1/2] Update to post json --- http/client.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/http/client.md b/http/client.md index 60ab12ba..98acfe91 100644 --- a/http/client.md +++ b/http/client.md @@ -32,8 +32,7 @@ In addition to `GET` requests, Vapor's client provides support for most common H ### POST as json ```swift -let jsonBytes = myJSON.makeBytes() -try drop.client.post("http://some-endpoint/json", headers: ["Auth": "Token my-auth-token"], body: .data(jsonBytes)) +try drop.client.post("http://some-endpoint/json", headers: ["Auth": "Token my-auth-token"], body: myJSON.makeBody()) ``` ### POST as x-www-form-urlencoded From c5ade0ef8937cfdb69407300210549706d87ef14 Mon Sep 17 00:00:00 2001 From: Casper Rasmussen Date: Mon, 20 Feb 2017 11:28:12 +0000 Subject: [PATCH 2/2] Update client.md --- http/client.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/client.md b/http/client.md index 98acfe91..1a09c96d 100644 --- a/http/client.md +++ b/http/client.md @@ -32,7 +32,7 @@ In addition to `GET` requests, Vapor's client provides support for most common H ### POST as json ```swift -try drop.client.post("http://some-endpoint/json", headers: ["Auth": "Token my-auth-token"], body: myJSON.makeBody()) +try drop.client.post("http://some-endpoint/json", headers: ["Content-Type": "application/json"], body: myJSON.makeBody()) ``` ### POST as x-www-form-urlencoded