473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

WinHTTP post using VB.NET not work

I am working on one VB.NET application where I am using WinHttp.dll to post request on website.

First request is for Login Page and I have gone through all input types of that page and pass those variables and value pair in Send method of WinHTTPRequest but it is not works.

Let' me inform you that this login page has viewstate hidden input type, so should I have to pass it in post string (String for Send method argument)

list of Input types are

Name Value Type
Arg1 3 Hidden
_ViewState Some Value Hidden
UserID "Test" Text
PWD "Test" Password
SignIn "Sign In" Button (works as Submit)

I create post string as
First Attempt:
"Arg1=3&_ViewState&UserID=Test&PWD=Test&SignIn=Sig n IN"
Second Attempt: without _ViewState
"Arg1=3&UserID=Test&PWD=Test&SignIn=Sign IN"
Third Attempt:without _ViewState and SignIn
"Arg1=3&UserID=Test&PWD=Test"

Action page in Form tag is same aspx as login aspx page.

when I try like

WinHTTPRequestObj.Send(PostStr)

Response = WinHTTPRequestObj.ResponseText

Response will be contain same page as Login aspx page

So, can you please help me
Aug 12 '05 #1
3 19092
izzy
12
I am working on one VB.NET application where I am using WinHttp.dll to post request on website.

First request is for Login Page and I have gone through all input types of that page and pass those variables and value pair in Send method of WinHTTPRequest but it is not works.

Let' me inform you that this login page has viewstate hidden input type, so should I have to pass it in post string (String for Send method argument)

list of Input types are

Name Value Type
Arg1 3 Hidden
_ViewState Some Value Hidden
UserID "Test" Text
PWD "Test" Password
SignIn "Sign In" Button (works as Submit)

I create post string as
First Attempt:
"Arg1=3&_ViewState&UserID=Test&PWD=Test&SignIn=Sig n IN"
Second Attempt: without _ViewState
"Arg1=3&UserID=Test&PWD=Test&SignIn=Sign IN"
Third Attempt:without _ViewState and SignIn
"Arg1=3&UserID=Test&PWD=Test"

Action page in Form tag is same aspx as login aspx page.

when I try like

WinHTTPRequestObj.Send(PostStr)

Response = WinHTTPRequestObj.ResponseText

Response will be contain same page as Login aspx page

So, can you please help me
WinHTTP is quite easy to use compared to other ways I have tried to POST data. I used your example as a starting point to try WinHTTP and found it did not work... Try adding the following line of code:

WinHTTPRequestObj.SetRequestHeader("content-type", "application/x-www-form-urlencoded")
Sep 3 '06 #2
izzy
12
Let me know if it works!
Sep 3 '06 #3
Thank for reply.....

There was big joke with me.....Website which I was trying to make request using WinHTTP has been changed and now they dont have cookie....and any how problem was solved.
Sep 4 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: thueirby | last post by:
h when i try to get data from site with clients sertificates with winHttp, I have a problem with result encoding (ru). Its OK with any sites without client sertificates, and its OK when i try to...
0
by: Bryce | last post by:
H I am using WinHTTP to hit a server. I need to provide Proxy credentials to navigate through a proxy server, as well as Server credentials to access the server I have called the...
1
by: Francis | last post by:
I have the following codes in an asp file. This page can receive the XML string send from client. ================================================== Dim objReceive Set objReceive =...
0
by: kaushalmbhavsar | last post by:
I am working on one VB.NET application where I am using WinHttp.dll to post request on website. First request is for Login Page and I have gone through all input types of that page and pass those...
1
by: saravana kumar | last post by:
Hai , I am new to winHTTP. Can anyone point me out a good website to find few startup samples and details about winHTTP. Please help me out to start winHTTP. :confused: Any help appreciated....
1
by: Gaetan | last post by:
I'm doing a prrof of concept to develop an application to run under WinPE. The application will use WinHTTP to send requests to an ASPX file running IIS 6.0 My problem is that I do not know how...
1
by: Balex | last post by:
Hi This is a question for people who know and use the winhttp DLL from MS. I need to be able to simulate the entry by users of data into a web-based application. So I started with using winhttp...
5
by: neilx | last post by:
I have a WinHttp.WinHttpRequest.5.1 object that works perfectly when GETing .htm pages, but times out when trying to GET .asp pages. I have tried using setCredentials: Set Http =...
4
by: Ted Lyngmo | last post by:
Hi! I'm new (but please do continue reading) to C++ in the VS environment and wanted to create a standalone program (or preferably, a static library, compatible with other Windows compilers)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.