# HTTP Post

**URL:** <https://techcommunity.softwareag.com/t/http-post/60199>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [September 21, 2005, 4:42pm UTC](https://techcommunity.softwareag.com/t/http-post/60199 "2005-09-21T16:42:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Claus](https://techcommunity.softwareag.com/u/Claus)\
**Post date:** [September 21, 2005, 4:42pm UTC](https://techcommunity.softwareag.com/t/http-post/60199/1 "2005-09-21T16:42:04Z")

</div>

Hi,

Do any of you have experience with HTTP Post from Natural for windoes ?

I have tried “Msxml2.XMLHTTP”, “Microsoft.XMLHTTP” and “WinHttp.WinHttpRequest”.

The first two gives me a parameter error (using datatype (A) or (B). I need to send the ‘request’ as binary), and the last one do not give me the expected result when using a variable as parameter.

Eksample :  
CREATE OBJECT #Object OF CLASS “WinHttp.WinHttpRequest.5.1”

send ‘open’ to #Object  
with ‘POST’ request-string ‘false’ (request-string is the URL (A))

send ‘send’ to #Object  
with my-request (my-request is the ‘body’ (A) or (B))

SEND “ResponseText” TO #Object  
RETURN Response-text (Response-text is the response (A))

I have tried to set the Content-type in the RequestHeader.

One strange ting is that if I do like this : (Not using a variable to hold the request)

send ‘send’ to #Object  
with “The request”

It works…

Regards Claus

---

<div class="post-metadata">

**Author:** ![BenedictXVII](https://avatars.discourse-cdn.com/v4/letter/b/50afbb/32.png) [@BenedictXVII](https://techcommunity.softwareag.com/u/BenedictXVII)\
**Post date:** [September 21, 2005, 6:53pm UTC](https://techcommunity.softwareag.com/t/http-post/60199/2 "2005-09-21T18:53:45Z")

</div>

It seems that the method you are calling insists on receiving the parameter ‘by value’, not ‘by reference’. If you pass a variable to a method (subprogram, … etc.), Natural passes the variable ‘by reference’, unless you use the option (AD=O). So I would give it a try and use (AD=O) when passing the variable. Hint: In order to see what exactly you have to pass to a method, you can consult Natural’s Component Browser. Good luck, +o:-]

---

<div class="post-metadata">

**Author:** ![Claus](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Claus](https://techcommunity.softwareag.com/u/Claus)\
**Post date:** [September 21, 2005, 7:14pm UTC](https://techcommunity.softwareag.com/t/http-post/60199/3 "2005-09-21T19:14:27Z")

</div>

Bennedict, you are the best !!!

I have searched for hours, I have been through the component browser 1000 times, I have tried several objects…

And then, it’s just a simple thing. :oops:

Thanks, a beer is added to your account… 8)

Claus

---

<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, 2:40pm UTC](https://techcommunity.softwareag.com/t/http-post/60199/4 "2021-04-02T14:40:17Z")

</div>


