Friday, November 2, 2018

Resolving Error 206 using nlapiRequestURL for an External Website URL

Based on Hypertext Transfer Protocol -- HTTP/1.1 RFC2616 Sec 10
HTTP Error 206 - Partial Content means:

 The response MUST include the following header fields:

      - Either a Content-Range header field (section 14.16) indicating
        the range included with this response, or a multipart/byteranges
        Content-Type including Content-Range fields for each part. If a
        Content-Length header field is present in the response, its
        value MUST match the actual number of OCTETs transmitted in the
        message-body.
      - Date
      - ETag and/or Content-Location, if the header would have been sent
        in a 200 response to the same request.
      - Expires, Cache-Control, and/or Vary, if the field-value might
        differ from that sent in any previous response for the same
        variant.

One reason why you might be having Error 206 is for setting the wrong Content-type.  
  
As stated on the Help Guide, NetSuite respects only the following two types when you pass the content type on the header :
 -"application/json"
 -"application/soap+xml"  
 
NetSuite will have the following defaults when no content type is passed for the header:
 -"text/xml; charset=UTF-8"
 -"application/x-www-form-urlencoded; charset=UTF-8" 
 
NOTE: Although these are the defaults, please do not pass this on your header, otherwise an Error 206 will be thrown.

 

No comments:

Post a Comment