From 6cead31707596598ff15d2eec9109e3423c75676 Mon Sep 17 00:00:00 2001 From: Casper Rasmussen Date: Thu, 12 Jan 2017 01:46:21 +0100 Subject: [PATCH] Updated with a form-data example --- http/client.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/http/client.md b/http/client.md index 7308fac1..e7632f6f 100644 --- a/http/client.md +++ b/http/client.md @@ -35,6 +35,17 @@ let bytes = myJSON.makeBytes() try drop.client.post("http://some-endpoint/json", headers: ["Auth": "Token my-auth-token"], body: .data(jsonBytes)) ``` +### Post as form-data +```swift +let result = try drop.client.post("http://some-endpoint", headers: [ + "Content-Type": "application/x-www-form-urlencoded" + ], body: Body.data( Node([ + "email": "mymail@vapor.codes" + ]).formURLEncoded())) + +``` + + ### Full Request To access additional functionality or custom methods, use the underlying `request` function directly.