title: NetSuite https.post() method response is giving Error "Unexpected character encountered while parsing value: S. Path '', line 0, position 0"
body: <p>I'm trying to send the below JSON data request to the 3rd party system using the &quot;N/https&quot; modules https.post() method.</p>
  <p>I'm getting the Response Code as &quot;200&quot; with Error Message <strong>&quot;Unexpected character encountered while parsing value: S. Path '', line 0, position 0&quot;</strong></p>
  <p><strong>Please refer my code given below</strong></p>
  <pre><code>var requestData = {
      &quot;terminal&quot;: &quot;345678&quot;,
      &quot;user&quot;: &quot;TestUser1234&quot;,
      &quot;password&quot;: &quot;XXXXXX&quot;,
      &quot;Currency&quot;: &quot;USD&quot;,
      &quot;Total&quot;: &quot;25&quot;,
      &quot;GoodURL&quot;: &quot;https://gatewayxx.test.com/sandbox/landingpage&quot;,
      &quot;Language&quot;: &quot;EN&quot;
  };
  
  log.debug('Typeof - RequestData: ', typeof requestData);
  
  var headerObj = new Array();
  headerObj['Content-Type'] = 'application/json';
  headerObj['Accept'] = 'application/json';
  
  var response = https.post({
      url: &quot;https://gatewayxx.test.com&quot;,
      body: requestData
  });
  </code></pre>
  <p><strong>HTTPS POST Reponses Message:</strong></p>
  <pre><code>{
      &quot;type&quot;: &quot;http.ClientResponse&quot;,
      &quot;code&quot;: 200,
      &quot;headers&quot;: {
          &quot;Cache-Control&quot;: &quot;private&quot;,
          &quot;Server&quot;: &quot;Microsoft-IIS/7.5&quot;,
          &quot;Content-Length&quot;: &quot;152&quot;,
          &quot;Date&quot;: &quot;Fri, 02 Oct 2020 05:44:47 GMT&quot;,
          &quot;Content-Type&quot;: &quot;text/html; charset=utf-8&quot;,
          &quot;Via&quot;: &quot;1.1 mono002&quot;
      },
      &quot;body&quot;: &quot;{\&quot;URL\&quot;:\&quot;\&quot;,\&quot;ConfirmationKey\&quot;:\&quot;\&quot;,\&quot;Error\&quot;:{\&quot;ErrCode\&quot;:599,\&quot;ErrMsg\&quot;:\&quot;Unexpected character encountered while parsing value: S. Path '', line 0, position 0.\&quot;}}&quot;
  }
  </code></pre>
  <p>I check my request data in JSON validator, There is no error in it. Also in the code I have validated it using the typeof property. It is also showing it as &quot;object&quot;.</p>
  <p>Also if you notice the response message it is giving the response &quot;Content-Type&quot; as &quot;text/html&quot; instead of JSON data.</p>
  <p>I'm not sure of what mistake I'm doing while sending the JSON data, can anyone help me to understand this issue.</p>
  <p>Thanks a lot in advance.</p>