VB 6.0 - winhttp post using vb does not work - Asked By raji abraham on 25-Jul-14 06:01 AM

I tested your wininethttp.dll component and it works fine.
I wanted to know when i use winhttp 5.0 for POST why it is not posting
any data to the asp page. If i have to do so what i have to do?

Can you send me your source code for wininethttp.dll?
The code might be help full to me as i wanted to develop a similar
component.

This is my vb code:

Dim x As New WinHttp.WinHttpRequest
x.Open "POST", "http://raji/asp/uploadfile/aspupload.asp", False 
   
//raji is my machine name and "s" is the variable with value "1"

x.Send(s = 1) 
MsgBox x.Status 
MsgBox Left(x.ResponseText, 500)

my asp page code:

<%
Response.Write("SS="&Request.form("s"))

%>

Help will be greatly appreciated.

Winhttp - Asked By Peter Bromberg on 25-Mar-03 04:59 PM

Dim HttpReq As Object
  '  (Don't use " as new xyz" with VB 6.0)

    ' Create the WinHTTPRequest ActiveX Object.
    Set HttpReq = New WinHttpRequest

    ' Initialize an HTTP request.  
    HttpReq.Open "POST", " "http://raji/asp/uploadfile/aspupload.asp", False 

    ' Post data to the HTTP server.
    HttpReq.Send "s=1"

you might also have to set a request header of :
httpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

winhttp unable to post data - Asked By raji abraham on 25-Jul-14 06:02 AM

I tried to do the same but it did not work.
As i told you earlier i have a VB applicaton through winhttp i am trying to post data to an asp page.

Here is the code for vb and asp try this code and let me know if it works

VB code:

Dim HttpReq As Object 
Set HttpReq = New WinHttpRequest 
HttpReq.Open "POST", " "http://raji/asp/uploadfile/aspupload.asp", False 
HttpReq.Send "s=1" 
msgbox(HttpReq.ResponseText)


ASP code:(aspupload.asp)

<%
Response.write(request.form(s))
%>


In the above example i am posting a variable "s=1" to an asp page and in asp page i am trying to display.
In the vb code the msgbox should displays the value of "s" here it is "1"
but i am getting empty space back.

Whem i used your wininethttp component to post  data using the method 
wininethttp.SendPost("s=1", "http://raji/asp/uploadfile/aspupload.asp", "POST")
it works fine.

I am testing this code on win2000 work station.

Can you test this code out and let me know why this is not working and why you component wininethttp is working fine.

Try setting the ContentType Request header - Asked By Peter Bromberg on 03-Apr-03 11:16 AM

HttpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

before you call the Send method.
ContentType Request header examples - Asked By raji abraham on 25-Jul-14 06:02 AM
 If i am posting data to an asp page what i have to  write in place of "application/x-www-form-urlencoded.
It Works fine - Asked By raji abraham on 25-Jul-14 06:02 AM
 it works fine.
Help appreciated.
Merlin voice playback is wonderfull.Is it something you developed?.
If so i would like to know more about it.
Let me know if you can help me find source for doing something like that.
No. the Merlin voice playback - Asked By Peter Bromberg on 03-Apr-03 12:56 PM
is not something I developed. I went through that childhood 3 years ago.
Geez!
Upload a file using Winhttp - Asked By raji abraham on 25-Jul-14 06:02 AM
Is there a way i can use winhttp.dll component in vb to upload a file from my machine to server.Can it be a secure connection.