Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to send POST data to a webserver?
#9
(05-01-2018, 10:35 PM)rlebeau Wrote: And, have you captured TIdHTTP's output, like I described earlier?
assign one of Indy's TIdLog... components to the TIdHTTP.Intercept property to see Indy's HTTP traffic
Not yet, I have never used the log component before and now when I look at the Indy10 docs I see that there are several such object to choose from. Don't know how to set it up and how to view its output...

Quote:One thing I notice that is missing from TIdHTTP's output that is present in Firefox's output is the 'Authorization' header.  By default, TIdHTTP will not transmit authentication credentials unless the server asks for them (in which case, you need to enable the hoInProcessAuth flag in the TIdHTTP.HTTPOptions property), or you set the TIdHTTP.Request.BasicAuthentication property to True (it is False by default).

So, try enabling authentication in your TIdHTTP so the Request.Username and Request.Password are actually sent to the server.  TIdHTTP's output should then look more like this:
My mistake, I thought that setting the user and password for IdHTTP would enable the authentication, so I did nothing else. Now I have enabled BasicAuthentication and tested again, but it seemingly made no difference.

Wireshark
I managed to set up a filter to capture the traffic on the http port with the IoT device IP address so I could capture the  actual data both for the FireFox case and using my FPC config application:

Code:
tcp port http and host 192.168.119.249

But these captures could only be viewed inside of Wireshark and then only one at a time, so it is very difficult to compare for differences. Tried to load a saved log into a text editor but that only showed unreadable data even though I saved to a text file format...


But I can see a definite difference towards the end of the logs, but I don't know what is relevant and not.
Reply


Messages In This Thread
How to send POST data to a webserver? - by BosseB - 04-30-2018, 09:56 PM
RE: How to send POST data to a webserver? - by BosseB - 05-02-2018, 12:45 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)