473,785 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WinHTTP post using VB.NET not work

4 New Member
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&_ViewSt ate&UserID=Test &PWD=Test&SignI n=Sign IN"
Second Attempt: without _ViewState
"Arg1=3&UserID= Test&PWD=Test&S ignIn=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

WinHTTPRequestO bj.Send(PostStr )

Response = WinHTTPRequestO bj.ResponseText

Response will be contain same page as Login aspx page

So, can you please help me
Aug 12 '05 #1
3 19136
izzy
12 New Member
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&_ViewSt ate&UserID=Test &PWD=Test&SignI n=Sign IN"
Second Attempt: without _ViewState
"Arg1=3&UserID= Test&PWD=Test&S ignIn=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

WinHTTPRequestO bj.Send(PostStr )

Response = WinHTTPRequestO bj.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:

WinHTTPRequestO bj.SetRequestHe ader("content-type", "applicatio n/x-www-form-urlencoded")
Sep 3 '06 #2
izzy
12 New Member
Let me know if it works!
Sep 3 '06 #3
kaushalmbhavsar
4 New Member
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
2608
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 do it manualy with IE any help would be really great script looks like that Set oHttp = CreateObject("WinHttp.WinHttpRequest.5") oHttp.Option(2) = "Windows-1251" ' WinHttpRequestOption_URLCodePage = 2
0
3452
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 SetCredentials method twice, once for the proxy user/pass and once for the server user/pass, but I am always returned with a 407 Dim oHTTP As New WinHttp.WinHttpReques oHTTP.Open "GET", "http://server/default.asp", Fals oHTTP.SetProxy 2, "192.168.1.105:8080...
1
20112
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 = Server.CreateObject("Microsoft.XMLDOM") objReceive.async=false On Error Resume Next objReceive.load(Request)
0
3167
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 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...
1
1872
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. Saravana Kumar
1
2291
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 to prevent IIS from returning the HTTP code of the ASPX page. The client side use something like this to initiate the request: set obj1 = createobject("WinHttp.WinHttpRequest.5.1") obj1.SetProxy HTTPREQUEST_PROXYSETTING_DIRECT obj1.Open "GET",...
1
5074
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 to "dialogue" with web servers from a VB.Net app. It works fine as long as the server is a straightforward http server. I am able to retrieve pages from such a server and to send "answers" to the server to get the next page, and so on. No problems....
5
2624
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 = CreateObject("WinHttp.WinHttpRequest.5.1") Http.Open "GET", "http://<path>/filename.asp", False Http.setCredentials "<domain>\Administrator", "<password>",0 Http.Send
4
2335
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) that; 1. Takes an URI as an argument. 2. Prints the proxy for that URI to stdout (or in the static library case, returns the resulting string).
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9954
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.