mirror of https://github.com/vapor/docs.git
Update to post json
This commit is contained in:
parent
9fa5e05082
commit
5a7c618a3b
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue