PostRequest_submit help

PostRequest_submit help

  
I am trying to call an URL using POST and i need to pass values as post body and set some headers. I could not find much information on using HTTPRequestHandler.PostRequest_Submit to achieve this. Appreciate if you could point some examples towards this.
Anyone successfully implemented post with outsytems ?
Hi Lokendar.

I don't have an example, but I think that the way to build the Arguments binary input, that I'm gessing is the tricky part, is to have a string with <argument_1>=<value_1>&<argument_2>=<value_2>&...&<argument_n>=<value_n> transform this from text to binary and feed it to the action.

Cheers,
Pedro
Hi,
Just to add..I think you can do it the way Pedro just said but in my opinion you should convert it to base64 and send it in this format.
Hope it helps.

Regards,
Gonçalo M.
Thanks Pedro, I have presently done as you have mentioned, but not getting any response.

Thanks Gonçalo. Let me try converting to base64 and see how it goes... 
Hi Gonçalo,

you can convert it to Base64, but that is not the way that HTTP works... see https://en.wikipedia.org/wiki/POST_(HTTP).

You can convert the values to base64 but the end point has to be aware of that. What you definitly need to do is to URL Encode de values.
Pedro Cardoso wrote:
Hi Gonçalo,

you can convert it to Base64, but that is not the way that HTTP works... see https://en.wikipedia.org/wiki/POST_(HTTP).

You can convert the values to base64 but the end point has to be aware of that. What you definitly need to do is to URL Encode de values.
 Hi Pedro,

You're totally right..My mistake and distraction..
So, Lokendar really has to Encode the values (this way also be aware about special characters and security issues) to do the POST.
Thank you for correcting me;)
 
All good Gonçalo!
Hi there!

What about adding custom headers?

I've opened the xif and C# code and I notice that the object beeing used is the System.Net.HttpWebRequest. One way is to clone this extension, add some extra arguments and pass then to the Headers collection of that object.

Any other way?