Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Winsock : GET Http Gives Me Bad Request , Why?


guys,

is the statement below wrong??

GET http://www.hypermart.com HTTP/1.0


the dataarrival shows me error message...

400 BAD Request

can anyone justify this please?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Winsock HTTP Request Help
I need help with this, my wrapper uses winsock to send requests and the close event does not fire which makes the connection stay open forever, my wrapper is at the bottom it is a attachment

HELP: Winsock To Send HTTP POST REQUEST To A Machine
Hello,

I would like to use visual basic to send data to a machine using an HTTP Post request, and cannot decide on the best way to do it. Can I use winsock. Please bear in mind the following.

I am sending a mult-part message (kind of like an email with attachments). It's actually a multimedia message in the MM7 format -> this is similar to email, a multipart MIME message.

I MUST post to a destination using the following format:

http://192.168.3.75:2097/mm7

I need to then send the data which I've formated according to the MM7 spec.

I need to receive responses from the receving application.

Any help would be greatly appreciated.

Thanks

Ben

Sending An HTTP Request Threw A HTTP Proxy
How can i send a HTTP Request threw a HTTP proxy using winsock

Like what are the special things that i have to put in the header?

Me Again-http Request
im using the inet control to make an http request. the server requires basic authentication (use of .htaccess and .htpasswd files for those of u who know about webservers, at least thats how it works with apache)

the problem is i dont understand how to authenticate.
i tried the usernameassword@site.com which a) is less secure so id rather not use it and b)it didnt even work

here are the specs
http://www.zoneedit.com/doc/dynamic.html#faq11

i need to be able to authenticate my username and password, and provide the host parameter

i have no clue how to do this with the inet ctrl.
plz help

HTTP Request
Hi,

I'm trying to make a application in visual basic where I need to block a HTTP request (URL) from a browser and display a default pae from the cache. the default page entry should be made in the cache in such a way so that the URL doesn't change. means instead of the actual page that will be returned i need to show another HTML content.

any help will be highly appreciated.

Thanks in advance.

Raj

HTTP Request
Hi,

I'm trying to make a application in visual basic where I need to block a HTTP request (URL) from a browser and display a default pae from the cache. the default page entry should be made in the cache in such a way so that the URL doesn't change. means instead of the actual page that will be returned i need to show another HTML content.

any help will be highly appreciated.

Thanks in advance.

Raj

HTTP Request
Hi,

I'm trying to make a application in visual basic where I need to block a HTTP request (URL) from a browser and display a default pae from the cache. the default page entry should be made in the cache in such a way so that the URL doesn't change. means instead of the actual page that will be returned i need to show another HTML content.

any help will be highly appreciated.

Thanks in advance.

Raj

Http Request
can anyone tell how to capture http requests in order to block websites?

HTTP Request
....my project is written as an ActiveX component, and doesn't have any
form. I need to make a HTTP request to an IIS server and get the contents of
a specific ASP file through this component. I'm trying to use the WebBrowser
control, and using the WebBrowser.Navigate2 "url" method to get at this
file. However, I keep getting an error saying 'invalid procedure call or
argument'. I've also tried using the XMLHTTPRequest object, with no success.

I'm assuming this is because the it's within an ActiveX project... I've
managed to do the same thing successfully using a WebBrowser control (with the same URL) when the
project is a standard EXE. Anyone know of any other way to achieve this?

Any thoughts, ideas, musing....thanks!

Pocket Pc Http Request
Hi,

I am developing a program to download data from http. The following code works fine for normal windows application. However, when I tests it using pocket pc phone edition 2003 emulator/ pocket device. it gives me the following error:

Chunk length was not valid.

Private Sub frmAccBalance_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim balance As Double
Dim str As String
Dim message As String

Me.ControlBox = False

Dim url As String = "http://203.92.112.140/vsmsc/checkBalance.php?sip_phone_no=657047&pin=12345678"

Try
Dim HttpWReq As HttpWebRequest = CType(WebRequest.Create(url), HttpWebRequest)
HttpWReq.AllowWriteStreamBuffering = True
HttpWReq.Method = "GET"
Dim HttpWResp As HttpWebResponse = CType(HttpWReq.GetResponse(), HttpWebResponse)
Dim ReceiveStream As Stream = HttpWResp.GetResponseStream()
Dim encode As Encoding = System.Text.Encoding.GetEncoding("utf-8")
Dim sr As New StreamReader(ReceiveStream, encode)

Dim read(256) As [Char]
Dim count As Integer = sr.Read(read, 0, 256)
While count > 0
str = New String(read, 0, count)
lblBalance.Text = (str)
count = sr.Read(read, 0, 256)
End While

Catch ex As WebException
message = ex.Message
Dim response As HttpWebResponse = CType(ex.Response, HttpWebResponse)
If Nothing Is response Then
Else
message = response.StatusDescription
response.Close()
End If
lblBalance.Text = message

Catch ex As Exception
lblBalance.Text = ex.message
End Try


End Sub


What is it with pocket pc phone edition? Any idea would be greatly appreciated.

Thanks in advance

HTTP Request Headers
Please help if you can. I am sending a GET request and I want to exactly emulate the IE HTTP Request Headers. I have even used a packet sniffer to try to replicate the request headers and have still have not found one way to write them that works for all GET requests. I get some to work with "& CrLf & CrLf" on the end of the headers and other times I have to put "& CrLf & CrLf & CrLf & CrLf" on the end to avoid getting a bad request message from the web sever I am sending the request to. If anyone know exactly what I should send in my HTTP Request headers to emulate IE, I would GREATLY appreciate it. Thanks!

Sending Http Request From Vb
I want to send http request from my vb client to htpserver.
Any good links..?

Http Request Handling
hello,

I am sending an Http Request which contains xml string to the browser through VB. But when the Length of xml string extends the maximum limit, the function which i have written doesn't works.

The problem is with the browser. it cannot accept more than 2000 characters, where as my string exceeds the limit !!!

Is there any API which can set the browsers max limit ???

Can anybody out there can solve my problem ..???

Http Request To A DLL Function @ IIS
Hi all....
Please help on this soon... If someone can post a sample code it is more useful for me at this time....

Question:
Is there any way to make http request to a DLL function, which resides in a IIS server, through Vb using API..Without using a OCX like(MSINET.OCX)....

Because this OCX causes crash my application at least without giving a single error message....

-Buddhi

How Can I Respond To An HTTP Request ?
hello all

I want my app to respond to browser request. How can my app send respond header ?
is it just sending a string containing the respon header to browser ?
if I want to add a file to send after the header, can I do it by sending binary transfer after I sent all the respon header ?

thanx

How Do I Make An Http Request?
Hiya!


I'm wondering if it is possible to make an http request from a VB6 program and how it is done??

What I want to do is checking a lot of links and see if they are alive.


Thanks,

Magnus Ohlin

Login && Password In HTTP Request
I am doing a HTTP Request to Exchange Server to retrieve some users Calendar data. Such as

http://exchange.company.com/public/?...nis.company.my

It returns me with a result into XML Format about the user availability.
That all works fine for me, except that i have to provide login and Password for exchange server. Can i include login/password in a HTTP Request (URL) itself. Later i have to integrate it in my VB Program and Parse XML. Please advise.

Opinion Request - FTP, SFTP, HTTP, Or OTHER???
Hello all. We have bookkeeping/accounting/tax software program that we wrote in VB6 which various clients use. We currently have them email us a .txt file of data which we then manually import into our master program. We also have a new web site, and .com domain, but I'm not sure of the potential for either in this regard.

My question is, what do you all recommend as the best approach to automate that data entry process: FTP, SFTP, HTTP, or OTHER??? Note that in the future we may also automate the "banking" part of this to where "direct deposit" of money is involved. So, confidential information like social security numbers and possibly bank routing numbers may be involved in the future.

If I understand the principles of this correctly, we just need to have the client send, or post the data somewhere, then we need to be able to get it and import it. What I have no idea about is what is the best approach to do all that or if it can be done in one step. What are the pro's and con's of the various methods?

Thank you for any input and suggestions on what you would recommend and why.

bjmarler

How To Build An Http Post Request ?
Recently i have been working on a small app that extracts data from a google sevice.
But now google has started an api service that allows users to directly post data to google accounts.here's the link
http://code.google.com/apis/accounts...alledApps.html

Now i have never worked with get/post http requests.So could some one guide on how to build one and then work with the responses that have arrived

Thanks

How Do I Send A Simple HTTP Request?
The code I have right now (copied from Microsoft's website) is this:
CODE    Dim hInternetSession       As Long
    Dim hInternetConnect       As Long
    Dim hHttpOpenRequest       As Long
    Dim sBuffer               As String * 1024
    Dim lBufferLength         As Long
    lBufferLength = Len(sBuffer)
    hInternetSession = InternetOpen(scUserAgent, _
        INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
    hInternetConnect = InternetConnect(hInternetSession, _
         "team.monkeycrap.com", INTERNET_DEFAULT_HTTP_PORT, _
         vbNullString, vbNullString, INTERNET_SERVICE_HTTP, 0, 0)
    hHttpOpenRequest = HttpOpenRequest(hInternetConnect, "GET", _
         "/cgi-bin/clan.pl?action=setserver&player=" + clanMember + "&server=" + serverIP + "&port=" + serverPort, "HTTP/1.0", vbNullString, 0, _
         INTERNET_FLAG_RELOAD, 0)
    HttpSendRequest hHttpOpenRequest, vbNullString, 0, 0, 0

Get IP Address (external) From HTTP Request
Hello everybody.
While making an HTTP Request, there are lots of information about the client in the HTTP Header, such as IP address of the client. So its possible to get the client's IP address; the external IP by looking for it in the header. So what I want is to send a request to abc.com, grab the header and then filter the IP address out of it.
So any help on how can I start this?
Thanks.

Vb Uploads A File Via Http Request
hola!

i am realy @ the end.... please try to help me!!

i spent hours looking throu tonns of help pages and newsgroups.

i just want to write a vb programm (activex thing used in another webpage) that uses a html page to post an image file.

i got the code to work but only once...
when i start the ocx it possible to make one request to the page, which functions quite well (althou it still dosn't upload a file - but don't care) and after compleating the function the programm goes on running but its not possible to klick anything or do anything.... the mousecursor stays set to bussy but the programm is just waiting for userinteraction....
so i just can stop the activex and rerun it - it works again but just once

here is the code (its a sample from http://www.tagconsulting.com/show.asp?Id=1025&S=3)

Code:Sub formpost()

'from http://www.tagconsulting.com/show.asp?Id=1025&S=3
'http://dev.uboot.com/cgi-bin/photoup.fcgi
' Open the connection

Dim hInternetOpen As Long
Dim hInternetConnect As Long
Dim hHttpOpenRequest As Long

hInternetOpen = InternetOpen("http generic", _
   INTERNET_OPEN_TYPE_PRECONFIG, _
   vbNullString, _
   vbNullString, _
   0)

' Identify the type of service that is being accessed
hInternetConnect = InternetConnect(hInternetOpen, _
   "dev.uboot.com", _
   INTERNET_DEFAULT_HTTP_PORT, _
   vbNullString, _
   "HTTP/1.0", _
   INTERNET_SERVICE_HTTP, _
   0, _
   0)

hHttpOpenRequest = HttpOpenRequest(hInternetConnect, _
   "POST", _
   "/cgi-bin/photoup.fcgi", _
   "HTTP/1.0", _
   vbNullString, _
   0, _
   INTERNET_FLAG_RELOAD, _
   0)

Dim sHeader As String
Dim bResult As Boolean

sHeader = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
bResult = HttpAddRequestHeaders(hHttpOpenRequest, _
   sHeader, Len(sHeader), HTTP_ADDREQ_FLAG_REPLACE _
   Or HTTP_ADDREQ_FLAG_ADD)

Dim lpszPostData As String
Dim lPostDataLen As Long

lpszPostData = "Id=1&S=2"
lPostDataLen = Len(lpszPostData)
bResult = HttpSendRequest(hHttpOpenRequest, _
   vbNullString, _
   0, _
   lpszPostData, _
   lPostDataLen)
Dim sBuffer As String
Dim sReadBuffer As String * 2048
Dim bDoLoop As Boolean
Dim lNumberOfBytesRead As Long

bDoLoop = True
While bDoLoop
   sReadBuffer = vbNullString
   bDoLoop = InternetReadFile(hHttpOpenRequest, _
      sReadBuffer, Len(sReadBuffer), lNumberOfBytesRead)
   sBuffer = sBuffer & _
      Left(sReadBuffer, lNumberOfBytesRead)
   If Not CBool(lNumberOfBytesRead) Then
      bDoLoop = False
   End If
Wend

MsgBox (sBuffer)


bResult = InternetCloseHandle(hHttpOpenRequest)
bResult = InternetCloseHandle(hInternetConnect)
bResult = InternetCloseHandle(hInternetOpen)

'Screen.MousePointer = 1


End Sub

p.s. the dev.uboot.com/cgi-bin/photoup.fcgi is not able to be accessed via the net - but it is functioning - i uploaded some photos....

it would be veryvery nice to get any ideas...

peace
michi

Still Trying To Send Cookie With HTTP Request
I can communicate with the server and the app works as long as a cookie exists on the workstation I am running on. The problem is that I need to be able to run on a workstation that does not have a cookie. I cut and pasted this out of Microsoft's VBHTTP example program. The cookie is just not going out correctly, if at all. Can anyone see what I am doing wrong? Thanks!

The URL is: is009999/dummy.com/ExprexxXXX?AccountId=12345678&TXN=SearchByAccountId&Format=XML"

Code: hInternetSession = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_PRECONFIG, _
        vbNullString, vbNullString, 0)
    If Not CBool(hInternetSession) Then
        MsgBox "Cannot Connect to Network", vbCritical + vbOKOnly, "Get Customer Information"
        ReadNet = ""
        Exit Function
    End If
    dwPort = 7001
    hInternetConnect = InternetConnect(hInternetSession, CheckUrl, dwPort, _
                            vbNullString, vbNullString, INTERNET_SERVICE_HTTP, 0, 0)

    hHttpOpenRequest = HttpOpenRequest(hInternetConnect, "GET", GetUrlObject, "HTTP/1.1", vbNullString, 0, _
                    INTERNET_FLAG_RELOAD Or INTERNET_FLAG_KEEP_CONNECTION, 0)

    SCookie = "Set-Cookie: ewebprefs=B,C,A,E@@NA@@999999@@NA@@V13"
    iRetVal = HttpAddRequestHeaders(hHttpOpenRequest, SCookie, Len(SCookie), _
            HTTP_ADDREQ_FLAG_REPLACE Or HTTP_ADDREQ_FLAG_ADD)

    sHeader = "Accept-Language: en" & vbCrLf
    iRetVal = HttpAddRequestHeaders(hHttpOpenRequest, sHeader, Len(sHeader), _
            HTTP_ADDREQ_FLAG_REPLACE Or HTTP_ADDREQ_FLAG_ADD)
                        
    sHeader = "Connection: Keep-Alive" & vbCrLf
    iRetVal = HttpAddRequestHeaders(hHttpOpenRequest, sHeader, Len(sHeader), _
            HTTP_ADDREQ_FLAG_REPLACE Or HTTP_ADDREQ_FLAG_ADD)
 
    sHeader = "Content-Type: text/html" & vbCrLf ' "Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd." & vbCrLf
    iRetVal = HttpAddRequestHeaders(hHttpOpenRequest, sHeader, Len(sHeader), _
            HTTP_ADDREQ_FLAG_REPLACE Or HTTP_ADDREQ_FLAG_ADD)
   
 iRetVal = HttpSendRequest(hHttpOpenRequest, vbNullString, 0, sData, Len(sData))
   
    DoEvents
    
    Sleep 1000 'sleep for one second
    sData = ""
    
    Do
        sBuffer = vbNullString
        bRet = InternetReadFile(hHttpOpenRequest, sBuffer, Len(sBuffer), lNumberOfBytesRead)
        If Not bRet Then Exit Do
        If Not CBool(lNumberOfBytesRead) Then Exit Do
        If (Len(sData) + lNumberOfBytesRead) <= 65534 Then
            sBuffer = sBuffer & Left$(sBuffer, lNumberOfBytesRead)
            sData = sData & sBuffer
        End If
    Loop
      
    ' Close Intranet connections
    If hInternetURL <> 0 Then InternetCloseHandle (hInternetURL)
    If hInternetSession <> 0 Then InternetCloseHandle (hInternetSession)

    ReadNet = sData

End Function

Read An HTTP Request Header ?
hello all.....

how can my app read an HTTP header request (from browser such as IE)?

how can I send a response header ?
is HTTP header is just a string ?

BIG Thanx

PS : I'm using VB, if you give me source code to do it, it would very nice
.....

Making A Http Request From An ActiveX Control
Can i make a http request from an activeX control to a asp page. Are there any standard controls or dlls available for perfoming this task. If so what are they? Pls help fast...

Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on planetsourcecode.com but there's a few things that aren't working.

Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect domain.com 80).

GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever
Referer: www.whatever.com

But when I used the website http://ipid.shat.net/ as the domain to see if code mdified the headers or not, it directed me instead to just www.shat.net. How would a browser request information to ipid.shat.net?

Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.

Http Request Header, Question About "Host:"
Hi everyone
When I make an HTTP request using winsocket I use the following:

Code:
GET http://www.somewebsite/index.html HTTP/1.1
Host: "--------"
..... and the reset of the request header


my question is, if I'm connecting to the internet using proxy server what should I put in "Host:"? Should it be the website I'm requesting from or the proxy server I'm using that is:
Host: www.somewebsite
or
Host: myproxyserver

Actually, I tried both, and it seems that both are working but I don't want to depend on guessing, one or the other is the correct way. Could someone please help me with this one.

Thanks

Winsock Request
I have a Winsock component setup right now on my network, exact same as whats in this thread

I would like to know if a similar control can be built using Winsock to do this:


1) Connect to a remote computer, by IP address. (I have a code that determines the IP address of the remote machine already..)

2) Open a .txt file, send it back to (my) the users computer and displays it in a text box on screen.

3) On command button press, take what ever is in my text box, and send the file back to the remote computer and save it.

Kind of like editing a configuration file, remotly.

I know the application would have to be running on the remote end as well as my end for this to work, if its at all possible.

I would really like to do this, I appeciate everyones help in advance!

Winsock Example Request
I'm at work where I can't get to any help files for winsock.  Can somebody give me a quick example of the code required to create a winsock instance, including telling it to listen and respont to internet requests?  I'm going to attempt to make MS Access act like a simple server, and I just don't have the resources here to get it running.  Thanks!

WinSock Request Accept
Hey,

I have been trying to get this code to work, It's most likely something stupid am doing, but i cant get my server program type thingie to accept the Request ID from the client program thingie... Here is the code to the part that it says is wrong (If you need anyother parts tell me an i'll post it)


Code:
Private Sub HostSocket_ConnectionRequest(ByVal requestID As Long)

'Show Request In Host Log
HMsg = "Connection request id " & requestID & " from " & HostSocket.RemoteHostIP
HostLog.AddItem (HMsg)

sRequestID = requestID
iSockets = iSockets + 1
ConNumber.Caption = iSockets
Load HostSocket(iSockets)
HostSocket.LocalPort = 1007
HostSocket.Accept requestID

End Sub
PS. I looked at an example to help me with this, so am not sure whats wrong.

Thx in advance.

Ali.

Can Winsock DLL Do Other Protocol Request ...
guys,

i find that the winsock OCX really is limited in its capability...
can anyone suggest me a better one for network programming? because the protocol type is limited to a few only....

I hope to do RTSP / RTP request ... is there any thing that i can used to do that ???

can Winsock Dll do other protocol request or its the total same with the winsock OCX?

Does anyone has a sample using winsock DLL (as client)...??

Multiple Request With Winsock
Greeting,

I have a little problem with winsock. I have a server and several
client. I want to transfer text from server to client trough the network
In this case, I using winsock to transfer the text. It is ok when only 2
computer connected (1 server and 1 client). But, when 3 computer
Connected (1 server and 2 client) I cant broadcast text to all client.

Does any body know how to broadcast text fom server to client trough the
network and winsock?

thanks

Rgds,
Rano Nugrah Agung Homan

Winsock Sample Request
Hi all,

I need to make a server app for my project. I have concluded that I will need to implement Winsock to do so. I have read up on all Winsock articles here (and many others elsewhere) and have downloaded and studied all the samples I could find.

However, I am unable to do what I want because:

- The tutorials say that the IP address or friendly name of the target computer MUST be specified for the Winsock control to connect on the other side. This strikes me as very backward, as I can not always know what IP addresses my customers' network stations will be running on and cannot also predict their friendly names. Does this have to be hard-coded?

- Try as I may, I cannot create a working sample of Server.Exe and Client.Exe to run on the same machine as I cannot afford the luxury of testing my code over two machines. Is there any way I can debug / test on one machine?

If any member proficient with Winsock (Laura Stephens and Jason Rogers come to mind) would like to help, I shall appreciate a small sample to get me started by solving the above two problems.

GoodGuy
Experience is a bad teacher for its exams precede its lessons.

Edited by - GoodGuy on 12/10/2007 10:23:30 PM

How To Make A "http Request"??
hi,
i would like to let my vb6 app perform an "http request"!?

the messages i want to receive are in XML format!

how can i do this?? i need to post and receive messages!

thx & greets

matthias

Winsock Array Connection Request
i made a post a couple days back gavino answered
im trying to make my multi chat program and well, it isnt goin by too well. for starters the client cant connect

Code:
Private Sub sckSocket_ConnectionRequest(Index As Integer, ByVal requestID As Long)
SockNum = SockNum + 1
Load sckSocket(SockNum)
sckSocket(SockNum).Listen
sckSocket(SockNum).Accept requestID
End Sub
is there sumthing wrong with that?

[VB6] Winsock POST Request Problem
I'm trying to connecto to google.com and translate a simple word (just to test if works).

And I have a problem when I'm sending POST request data, here is my code:


Code:
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "www.google.com", "80"
End Sub


Private Sub Winsock1_Connect()
Dim packet As String
Dim strpost As String

strpost = "hl=it&ie=UTF8&text=hello&sl=en&sl=en&tl=it&tl=it"

packet = "POST /translate_t HTTP/1.1" & vbCrLf
packet = packet & "Host: www.google.com" & vbCrLf
packet = packet & "Accept: */*" & vbCrLf
packet = packet & "Accept-Language: it,it-it;q=0.8,en;q=0.5,en-us;q=0.3" & vbCrLf & vbCrLf

packet = packet & "Content-Type: " & "application/x-www-form-urlencoded" & vbCrLf
packet = packet & "Content-Length: " & Len(strpost) & vbCrLf
packet = packet & strpost

Winsock1.SendData packet

Text1.Text = Text1.Text & packet

End Sub


Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String

Winsock1.GetData data
Text2.Text = Text2.Text & data & vbCrLf

End Sub



As you can see I want the GETDATA in Text2.Text but I recieve this error:


Code:
HTTP/1.1 411 Length Required
Date: Fri, 01 Aug 2008 13:57:24 GMT
Content-Type: text/html; charset=UTF-8
Server: GFE/1.3
Content-Length: 1357

{html code}


What's the problem?!

Thanks in advance.

How Can You Request A Webpage Using Winsock And HTTPS?
HTTP is easy to form requests with using winsock..
but how can you make requests to a https site?

WinSock Connection Request Error!
When I use this code for a winsock connection request:

Code:
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
txtRecive.Text = txtRecive.Text & vbCrLf & "ChatX: Connection Request Detected."
End Sub


I get runtime error 40020:
Invalid operation at current state

when I hit debug it highlights that code snippet up there! HELP

Viewing Cookies Sent With Either Winsock Or INet Request?
Hello,

Is there a way that I can send a request via INET (Most Likely), and read the cookies which were sent with that request?

Thanks

Winsock Server Connection Request Problem
hey, this is my code


Code:
Private Sub wskServer_ConnectionRequest(ByVal requestID As Long)
Dim msgboxResult

msgboxResult = MsgBox("A connect request has been initiated by: " & wskServer.RemoteHostIP & vbNewLine & "Would you like to accept it?", vbYesNo, "Connection Request")

If msgboxResult = vbYes Then
wskServer.Accept requestID
isServer = True
End If
End Sub


now the problem is, whenever i run it, and have a client try to connect to it, this is the error the server gives me on this line "wskServer.Accept requestID"

---------------------------
Project1
---------------------------
Run-time error '40020':

Invalid operation at current state
---------------------------
OK
---------------------------

can someone help?


EDIT: and yes, i did try:
wskServer.Close
wskServer.Accept requestID

but it doesn't work. if u need 2 see my whole code to know whats going on, just let me know

Winsock/cookie Request Entity Too Large...
hi i'm sending a cookie header via winsock but i think it's to large cause I'm receiving a "Request Entity Too Large" in the HTTP Response. is there a way around this?

Winsock - Notification When User Accepts Request
Does anyone know of a way that an initiator of a Winsock connection can be notified when a user on the other end accepts the connection ? I'm new to Winsock, so my terminology might not be the best, but I'm trying to find out if the inititator has any way of knowing that a connection was made before any messages are exchanged?

Thanks for any help....

Does Anyone Have An Example Of How To Send A POST Request With Winsock And A Proxy?
I know how GET works with winsock and a proxy, but how can you use a proxy and use POST?

anyone have an example?

HTTP Via Winsock
I cant find anything about how to send passwords through HTTP protocol. What is the command for the password and username?

Anyone know any links?

Winsock && HTTP
im trying to use the Winsock controll to connect to "http://www.geocities.com"... Kinda like a web browser..

But the problem, if i put "http://www.geocities.com" or "www.geocities.com" in the RemoteIP property, i get an error becuase it has to be a numeric value..

Anybody know how to get the IP address for "http://www.geocities.com", or anybody know how to switch these kinds of things so no matter what site somebody types in it always converts it to an IP address and sends them there, im so lost! I gotta use the winsock control though

Winsock And Http
Hi,

I have never tried to use winsock control and now I wish to learn it.

I want to make program with gets data from one url, trim it and shot it in label.

Can anybody give me the examples how to use it?

Thanks

HTTP With WinSock
OK, what i need is very simple. I need the user to be able to
connect to my machine through the browser. I want WinSock to
then send some HTML data out. Is this possible?

I can get it to connect via the browser, but when i send the
HTML, the browser just goes to the "page cannot be displayed"
thing.

Someone...anyone...help

Luke

HTTP Winsock Problem
Code:
Private Sub cmdget_Click()
socket.Connect "chat.msn.com", 80
End Sub

Private Sub Socket_connect()
socket.SendData "GET /default.msnw?" & "HTTP/1.0" & vbCrLf & vbCrLf
socket.SendData "User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) " & vbCrLf & vbCrLf
socket.SendData "Host: chat.msn.com " & vbCrLf & vbCrLf
socket.SendData "Connection: Keep-alive " & vbCrLf & vbCrLf
End Sub

Code:
Data sent back

HTTP/1.1 302 Moved
Date: Sun, 27 Jun 2004 11:16:54 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
P3P:CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo"
Location: /ns.msnw
Content-Length: 0
I've worked with sockets in mirc and I basically just tried to translate the code into vb. I think this


Code:
socket.SendData "User-Agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) " & vbCrLf & vbCrLf
is the problem. Could someone show me the correct way to send that string, thanks

VB Winsock Control And HTTP
I am trying to make a simple HTTP application, to help me understand HTTP.

When I use the winsock control to try and connect to http://www.google.com with the remote port set to 80, the connection refuses to happen, and the winsock times out? Any suggestions this has never happened to me before, unless the server wasn't present.

Copyright © 2005-08 www.BigResource.com, All rights reserved