Page 1 of 1

HTTPRequest Post?

Posted: Sat Dec 06, 2025 9:50 am
by LastLife
Hello!
I'm looking for an example of a post request, sending actual data to the server?
The documentation doesn't provide any, and even a google search on the whole domain comes up empty.

Re: HTTPRequest Post?

Posted: Sat Dec 06, 2025 11:23 am
by plouf
this is an example sending 2 form fields

Code: Select all

  Procedure HttpGetEvent(Success, Result$, UserData)
    ; HTTPInfo() can also be used to get more info about the request result
    If Success
      Debug Result$
    Else
      Debug "HTTPRequest(): Error"
    EndIf
  EndProcedure

  
  HTTPRequest(#PB_HTTP_Post, "http://127.0.0.1:8888/plouf/info.php", "formNAME=plouf&formCOUNTRY=GR", @HttpGetEvent(), 0)

Re: HTTPRequest Post?

Posted: Sat Dec 06, 2025 1:11 pm
by LastLife
Wouldn't that send the data unencrypted?

Re: HTTPRequest Post?

Posted: Sat Dec 06, 2025 2:07 pm
by plouf
Yes
But changinsg to httpS ..wil not ;-)

Btw you dont need http at all in local website only relative i.e.
/Plouf/info.php. If is hosted in ssl website will be ssl :-)
Thats the server/client responsibility not yours

Re: HTTPRequest Post?

Posted: Sat Dec 06, 2025 3:39 pm
by LastLife
Okay, I thought the parameters were basically the same thing as doing it in the URL (like http://example.com/index.html?something=something), so I was confused.

Thanks a lot 🫡