# REQUEST DOCUMENT WITH DATA gives me 401 http response

**URL:** <https://techcommunity.softwareag.com/t/request-document-with-data-gives-me-401-http-response/100755>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Web-and-XML-Technology\
**Created:** [June 15, 2012, 10:45pm UTC](https://techcommunity.softwareag.com/t/request-document-with-data-gives-me-401-http-response/100755 "2012-06-15T22:45:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gil\_Wildin](https://avatars.discourse-cdn.com/v4/letter/g/8c91f0/32.png) [@Gil\_Wildin](https://techcommunity.softwareag.com/u/Gil_Wildin)\
**Post date:** [June 15, 2012, 10:45pm UTC](https://techcommunity.softwareag.com/t/request-document-with-data-gives-me-401-http-response/100755/1 "2012-06-15T22:45:39Z")

</div>

Hello, this is my first attempt at using the Request Document WITH DATA statement. If I comment out the WITH DATA lines, I get a 200 and parse the document, no problem. But if I try it WITH DATA as in the code below, I get the 401 response. Is it my code or do I need something else done to the file permissions or access? Thank you.  
HELLO  
#RC: 401  
HTTP RESPONSE 401 RECEIVED  
(which means access denied).  
------code snippet below----------------  
ASSIGN #FROM =  
‘[https://dpdev1.dp.utexas.edu/nlogon/wci/sample.xml](https://dpdev1.dp.utexas.edu/nlogon/wci/sample.xml)’  
\*\*  
WRITE ‘HELLO’  
\*\*  
COMPRESS  
‘\<?xml version="1.0" encoding="ISO-8859-1" ?\>’  
‘’  
’ ’  
’ Gambardella, Missy’  
’ XML Developer Guide’  
’ Agriculture’  
’ 44.95’  
‘\<publish\_date\>2000-10-01\</publish\_date\>’  
‘An in-depth look at driving farm tractors’  
‘with XML.’  
‘’  
‘’  
INTO #DOCUMENT

REQUEST DOCUMENT FROM #FROM  
WITH  
DATA ALL #DOCUMENT  
RETURN  
PAGE #PAGE  
RESPONSE #RC  
GIVING #RTERR  
\*\*  
WRITE ‘=’ #RC  
IF #RC NE 200 /\* TEST FOR HTTP RESPONSE 200 = ‘OK’  
WRITE ‘HTTP RESPONSE’ #RC ‘RECEIVED’  
ESCAPE ROUTINE  
END-IF  
\*  
…

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [June 17, 2012, 6:04pm UTC](https://techcommunity.softwareag.com/t/request-document-with-data-gives-me-401-http-response/100755/2 "2012-06-17T18:04:31Z")

</div>

using the DATA ALL clause causes Natural to send the request as a PUT, so presumably you are attempting to store the document you are sending. Which probably requires different permission levels than a GET or POST, which are typically “read” requests.

You need to check the permission settings for the service you are calling. Web servers don’t usually default to letting you do writes to their file systems.

---

<div class="post-metadata">

**Author:** ![Gil\_Wildin](https://avatars.discourse-cdn.com/v4/letter/g/8c91f0/32.png) [@Gil\_Wildin](https://techcommunity.softwareag.com/u/Gil_Wildin)\
**Post date:** [June 19, 2012, 2:43pm UTC](https://techcommunity.softwareag.com/t/request-document-with-data-gives-me-401-http-response/100755/3 "2012-06-19T14:43:39Z")

</div>

Thank you, that is what I suspected. I’ll check with the web server admins and see what needs to be done.

---

<div class="post-metadata">

**Author:** ![Eric\_Schindler](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@Eric\_Schindler](https://techcommunity.softwareag.com/u/Eric_Schindler)\
**Post date:** [July 2, 2012, 9:42am UTC](https://techcommunity.softwareag.com/t/request-document-with-data-gives-me-401-http-response/100755/4 "2012-07-02T09:42:13Z")

</div>

See documentation:

You can add a header ‘Request-Method’ to overwrite the internally computed PUT

WITH  
HEADER  
NAME ‘Request-Method’ VALUE ‘POST’

→ May have a look at the code sample “Issuing a SOAP request and parsing the response”

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:02pm UTC](https://techcommunity.softwareag.com/t/request-document-with-data-gives-me-401-http-response/100755/5 "2021-04-02T15:02:04Z")

</div>


