Monday, June 24, 2019

Send JSON Over Using nlapiRequestURL

The following code would not work using  nlapiRequestURL to send JSON Data to a Services:

var jsonVar = [{"email":"john@email.com","lastname":"Famous","firstname":"John"}];

var response = nlapiRequestURL(url, jsonVar, header, "POST");

 

The following code would work:

var jsonVar = [{"email":"john@email.com","lastname":"Famous","firstname":"John"}];

var data = JSON.stringify(jsonVar);

var response = nlapiRequestURL(url, data, header, "POST");

 

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete