Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
https POST request Posted by Eryto Milanski on 5 Feb 2006 at 8:33 AM


Hi,

I try to realize follow request:

https://www.someurl.com/script.php?param1=value1&param2=value2

It's not work, when I try to use this:
WebBrowser.Navigate('https://www.someurl.com/script.php?param1=value1&param2=value2
')

I try second method:


strPostData := 'param1=value1&param2=value2';
PostData := VarArrayCreate([0, Length(strPostData) - 1], varByte);
Data := VarArrayLock(PostData);
try
Move(strPostData[1], Data^, Length(strPostData));
finally
VarArrayUnlock(PostData);
end;
URL := 'https://www.someurl.com/script.php';
Flags := EmptyParam;
TargetFrameName := EmptyParam;
Headers := EmptyParam;
Form1.Web.Navigate2(URL, Flags, TargetFrameName, PostData, Headers);

But it's not working too..

Any ideas? May be I wrong some with headers?

Thank you!
Report
Re: https POST request Posted by zibadian on 5 Feb 2006 at 9:12 AM
:
:
: Hi,
:
: I try to realize follow request:
:
: https://www.someurl.com/script.php?param1=value1&param2=value2
:
: It's not work, when I try to use this:
: WebBrowser.Navigate('https://www.someurl.com/script.php?param1=value1&param2=value2
: ')
:
: I try second method:
:
:
: strPostData := 'param1=value1&param2=value2';
: PostData := VarArrayCreate([0, Length(strPostData) - 1], varByte);
: Data := VarArrayLock(PostData);
: try
: Move(strPostData[1], Data^, Length(strPostData));
: finally
: VarArrayUnlock(PostData);
: end;
: URL := 'https://www.someurl.com/script.php';
: Flags := EmptyParam;
: TargetFrameName := EmptyParam;
: Headers := EmptyParam;
: Form1.Web.Navigate2(URL, Flags, TargetFrameName, PostData, Headers);
:
: But it's not working too..
:
: Any ideas? May be I wrong some with headers?
:
: Thank you!
:
The Navigate() method of the TWebBrowser doesn't make a POST request, but a GET request.
Report
Re: https POST request Posted by Eryto Milanski on 5 Feb 2006 at 12:32 PM

: The Navigate() method of the TWebBrowser doesn't make a POST request, but a GET request.
:

That's true, but I've used Navigate2() method too, but it can't work too!
Here is from Delphi's help:

"PostData contains the data sent to the server when using Navigate to generate an HTTP POST message. If PostData is NULL, Navigate generates an HTTP GET message. PostData is ignored if URL does not specify an HTTP URL."

Well, I've can't sent the request...




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.