monkey2 icon indicating copy to clipboard operation
monkey2 copied to clipboard

POST HttpRequest

Open bosh77b opened this issue 7 years ago • 2 comments

I'm trying to create a "POST" httprequest but it does not work: The server can not read the sent string. Can someone help me? thank you

bosh77b avatar Dec 03 '18 18:12 bosh77b

What target? Can you provide some runnable example code?

On Tue, 4 Dec 2018 at 7:47 AM, bosh77 [email protected] wrote:

I'm trying to create a "POST" httprequest but it does not work. Can someone help me? thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/441, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3QtvV6R_67Fb-xG-EHYf6cZQxbhx-ks5u1XG6gaJpZM4Y_L4b .

blitz-research avatar Dec 08 '18 04:12 blitz-research

Version are Windows and Linux. Now works. the syntax is wrong in the wget command: use "--body-data" instead of "-post-data". Moreover, it is better to use "curl" instead "wget", because it also allows you to make POST httprequests even with large data files.

In Emscripten version i have error: "Exception thrown, see JavaScript console". Piece of sample code:

Global req:HttpRequest
...
req=New HttpRequest
...
req.Open("POST","https://....../prova.php")    'returns the sent string
req.Send("test string")

How can I see JavaScript console? Thanks

bosh77b avatar Jan 01 '19 12:01 bosh77b