Commit ee171f98 authored by Nicolai Kamenzky's avatar Nicolai Kamenzky
Browse files

Merge pull request #115 from EvanCarroll/master

Doc updates
parents 2854e046 c3bb0dcf
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -102,10 +102,14 @@ rp(options)

### POST data to a JSON REST API

Set option.body to data, and json:true to encode the body as JSON. See below
for HTML forms.


``` js
var options = {
    method: 'POST',
    uri: 'http://posttestserver.com/post.php',
    uri: 'http://api.posttestserver.com/post',
    body: {
        some: 'payload'
    },
@@ -123,6 +127,8 @@ rp(options)

### POST like HTML forms do

Set option.form to encode the body as HTML form

``` js
var options = {
    method: 'POST',