Solved

[delphi] how to read response headers

Posted on 2011-02-20
4
745 Views
Last Modified: 2012-05-11
I using http in delphi. How can i read response headers?  from POST i send one post like this:
http.Post('http://www.plemiona.pl/index.php?action=login&server_pl51?', Input2, Output2);

Open in new window

 i need to get response location where i can find session. Please help me
0
Comment
Question by:l3m0n
  • 2
4 Comments
 

Author Comment

by:l3m0n
Comment Utility
i used it:
memo2.Lines:=http.Response.RawHeaders;

Open in new window

but i get different information then fiddler shows:
i get:
Connection: keep-alive
X-Powered-By: PHP/5.2.0-8+etch16
Cache-Control: no-cache
Pragma: no-cache
Content-type: text/html; charset=utf-8
Content-Length: 24947
Date: Sun, 20 Feb 2011 12:40:47 GMT
Server: lighttpd/1.4.19

fiddler gets:
HTTP/1.1 302 Found
Transfer-Encoding: chunked
X-Powered-By: PHP/5.2.0-8+etch16
Location: http://pl51.plemiona.pl/login.php?sid=0bafb06d929c&secret=0&mobile_no_force=0
Content-Encoding: gzip
Vary: Accept-Encoding
Content-type: text/html; charset=utf-8
Date: Sun, 20 Feb 2011 12:33:46 GMT
Server: lighttpd/1.4.19

i have done:
http.allowcookies := true;
http.HandleRedirects:=true;
0
 
LVL 24

Expert Comment

by:jimyX
Comment Utility
Try:
memo2.Lines := http.Response.ResponseText;

Open in new window

0
 

Author Comment

by:l3m0n
Comment Utility
ResponseText? it store: "HTTP/1.0 200 OK"
0
 
LVL 21

Accepted Solution

by:
developmentguru earned 500 total points
Comment Utility
I am not sure how much help I can be with this but, in order to try, I would need ALL of the parameters you passed.  I would need to know how you setup to do this.  I would also (very important) need to know what version of Delphi you are using (I only have 2010 and XE).  If you have any information about what tools were used to put the other end together that could help as well.  In the last few releases Delphi's handling of SOME of the headers data has changed quite a bit.

Once you have given me this information, I will see if I can help.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now