HTTPRequest Post?

Just starting out? Need help? Post your questions and find answers here.
LastLife
Posts: 5
Joined: Fri Dec 27, 2024 1:48 am

HTTPRequest Post?

Post 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.
plouf
Posts: 297
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: HTTPRequest Post?

Post 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)
Christos
LastLife
Posts: 5
Joined: Fri Dec 27, 2024 1:48 am

Re: HTTPRequest Post?

Post by LastLife »

Wouldn't that send the data unencrypted?
plouf
Posts: 297
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: HTTPRequest Post?

Post 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
Christos
LastLife
Posts: 5
Joined: Fri Dec 27, 2024 1:48 am

Re: HTTPRequest Post?

Post 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 🫡
Post Reply