Commit c3bb0dcf authored by Evan Carroll's avatar Evan Carroll
Browse files

updated to better differentiate json/html forms because underlying request.pm...

updated to better differentiate json/html forms because underlying request.pm is really bad at giving a sane error here.
parent 2854e046
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',