Welcome Guest Search | Active Topics | Sign In | Register

Sending a request using Request and PostData Options
jrk
Posted: Tuesday, August 21, 2018 5:41:35 PM
Rank: Newbie
Groups: Member

Joined: 8/21/2018
Posts: 5
We recently purchased your software for a few projects...and I'm new to using it. I'm trying to send a request to my server sending it several key value pairs for authentication, as if I would do when sending a HTML Form. A code snippet of this is as follows:

DEFINE VARIABLE httpRequest AS EO.WebBrowser.Request NO-UNDO.

httpRequest = NEW EO.WebBrowser.Request("http://IFRMS-DEV05:80/DataPA/Dashboard.aspx":U).
httpRequest:PostData:AddValue("ID":U, "837d2b90-df70-4b1d-89f5-5af286aa701a":U).
httpRequest:PostData:AddValue("autoLogin":U, "true":U).
httpRequest:PostData:AddValue("username":U, "abc":U).
httpRequest:PostData:AddValue("password":U, "def":U).
httpRequest:METHOD = "GET":U.
webView1:LoadRequest(httpRequest).


When I track the result of above through Chrome Dev Tools, I see that my request method has been set to "POST". Either I must be setting this object's property incorrectly, or, maybe EO forces method to "POST" due the fact that I'm using PostData?

The server I'm sending the request to requires method be set to "GET" (3rd Party Server/Software), and when I change to this to a "GET" via other methods, it works.

Am I setting this property incorrectly, or does OE always force "POST" on using the Request object, at least as I've shown above?

Again, I'm new to this, so if I'm missed something, my apologies. Ready through as much examples via Support and online references as I can find.
eo_support
Posted: Wednesday, August 22, 2018 11:48:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

PostData would force the method to POST. Have you tried to append your arguments to the query string, such as "Dashboard.aspx?ID=xxxx&autoLogin=true..."?

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.