Monday, November 26, 2018

nlapiRequestURL > HTTP Status Code 207 Multi-Status/Multi-Response

 

HTTP 207 Status Code definition:

 The message body that follows is an XML message and can contain a number of separate response codes,
 depending on how many sub-requests were made.

This means that there are multiple responses returned for the request made using the nlapiRequestURL. Although
this can be a valid return, this is not supported by the nlapiRequestURL.

The actual response returned by code nlobjResponse.getBody() is empty('').While, the multiple responses can
be acquired using a Web debugging tool such as Fiddler.
 
Sample response from Fiddler is posted below, notice that this have 3 responses and all of which is HTTP 200-OK
 
<?xml version="1.0" encoding="utf-8" ?>
- <D:multistatus xmlns:D="DAV:">
 - <D:response>
    <D:href>https://....</D:href>
  - <D:propstat>
   <D:status>HTTP/1.1 200 OK</D:status>
   <D:prop>
      <D:getcontenttype>text/plain</D:getcontenttype>
      <D:getlastmodified>Mon, 14 May 2012 18:15:58 GMT</D:getlastmodified>
      <D:displayname>imp.txt</D:displayname>
      <D:getcontentlength>0</D:getcontentlength>
      <D:iscollection>True</D:iscollection>
   </D:prop>
    </D:propstat>
   </D:response>
  
 - <D:response>
    <D:href>https://....</D:href>
  - <D:propstat>
   <D:status>HTTP/1.1 200 OK</D:status>
   <D:prop>
      <D:getcontenttype>text/plain</D:getcontenttype>
      <D:getlastmodified>Mon, 14 May 2012 18:15:58 GMT</D:getlastmodified>
      <D:displayname>temp.txt</D:displayname>
      <D:getcontentlength>99</D:getcontentlength>
      <D:iscollection>False</D:iscollection>
      <D:creationdate>2012-05-14T18:15:58.481Z</D:creationdate>
   </D:prop>
    </D:propstat>
   </D:response>
  
 - <D:response>
    <D:href>https://...</D:href>
  - <D:propstat>
   <D:status>HTTP/1.1 200 OK</D:status>
   <D:prop>
      <D:getcontenttype>text/plain</D:getcontenttype>
      <D:getlastmodified>Wed, 16 May 2012 07:18:25 GMT</D:getlastmodified>
      <D:displayname>test.txt</D:displayname>
      <D:getcontentlength>7</D:getcontentlength>
      <D:iscollection>False</D:iscollection>
      <D:creationdate>2012-05-14T17:16:21.228Z</D:creationdate>
   </D:prop>
    </D:propstat>
   </D:response>
</D:multistatus>

 

No comments:

Post a Comment