Updated with a form-data example

This commit is contained in:
Casper Rasmussen 2017-01-12 01:46:21 +01:00 committed by GitHub
parent e0b5077979
commit 6cead31707
1 changed files with 11 additions and 0 deletions

View File

@ -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.