Archived Forum Post

Index of archived forum posts

Question:

URL parameter is being sent as POST parameter

May 29 '15 at 11:20

I need to make a x-www-form-urlencoded type post to a url like string url = "portal.demo.com/login/auth?cmd=login"

if I adding a URL parameter, the extra URL parameter is being added to list of POST params.

Here is my snippet of code.

++++++++++++++++++++++++++++++++

Dim req As New ChilkatHttpRequest

req.AddParam "userid", "demo"

req.AddParam "password", "demo"

Dim resp As ChilkatHttpResponse

Set resp = http.PostUrlEncoded("www.mysite.com/login/auth?cmd=login", req)

If (resp Is Nothing) Then

Text1.Text = Text1.Text & http.LastErrorText & vbCrLf

Exit Sub

Else

Text1.Text = Text1.Text & resp.Header

End If

+++++++++++++++++++++++++++++++++++++++

result like that:

POST /login/auth HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0 Accept: / Accept-Language: en-US,en;q=0.5 Content-Type: application/x-www-form-urlencoded Host: www.mysite.com Content-Length: 178 userid=demo&passwort=demo&cmd=login

instead of:

POST /login/auth?cmd=login HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0 Accept: / Accept-Language: en-US,en;q=0.5 Content-Type: application/x-www-form-urlencoded Host: www.mysite.com Content-Length: 178 userid=demo&passwort=demo

Can you help?


Accepted Answer

See this example:

Android: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

C: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

C#: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

C# WinRT: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

C++: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Classic ASP: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

DataFlex: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Delphi ActiveX: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Delphi DLL: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Java: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Lianja: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

MFC: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Objective-C: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Perl: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

PHP ActiveX: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

PHP Extension: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

PowerBuilder: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

PowerShell: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

PureBasic: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Python: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Ruby: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

SQL Server: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Swift: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Unicode C: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Unicode C++: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

VB.NET: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

VB.NET WinRT: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

VBScript: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Visual Basic 6.0: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body

Visual FoxPro: HTTP POST with some Params in URL and others in application/x-www-form-urlencoded Body