Solved

[delphi] how to read response headers

Posted on 2011-02-20
4
763 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
ID: 34937060
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
ID: 34937288
Try:
memo2.Lines := http.Response.ResponseText;

Open in new window

0
 

Author Comment

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

Accepted Solution

by:
developmentguru earned 500 total points
ID: 34943699
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

26 Experts available now in Live!

Get 1:1 Help Now