diff --git a/http/client.md b/http/client.md index 7308fac1..7e59a180 100644 --- a/http/client.md +++ b/http/client.md @@ -30,11 +30,21 @@ try drop.client.get("https://api.spotify.com/v1/search", query: ["type": "artist In addition to `GET` requests, Vapor's client provides support for most common HTTP functions. `GET`, `POST`, `PUT`, `PATCH`, `DELETE` +### POST as json ```swift let bytes = myJSON.makeBytes() try drop.client.post("http://some-endpoint/json", headers: ["Auth": "Token my-auth-token"], body: .data(jsonBytes)) ``` +### POST as x-www-form-urlencoded +```swift +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.