-
Hi,
I'm having the following problem trying to post data to a cgi sript on the web.. It keeps giving me a "501: Not Implemented" error when trying to post via Winsock.. However, if I use the exact same data and paste it into the web browser directly, it goes through.. Any ideas?
Thanks,
Dan
-
Can you post the code that posts via Winsock?
-
Code:
Private Sub Submit(Data As String)
Dim sListing As String
'-- construct HTTP request
sListing = "POST /blablapath/script.cgi HTTP/1.0" & vbCrLf
sListing = sListing & "Accept: text/plain" & vbCrLf
sListing = sListing & "Content-type: application/x-www-form-urlencoded" & vbCrLf
sListing = sListing & "Content-length:" & Str(Len(Data)) & vbCrLf
sListing = sListing & vbCrLf
sListing = sListing & Data & vbCrLf & vbCrLf
'-- send the request
If Winsock1.State = sckClosed Then
Connect
Winsock1.SendData sListing
Else
Winsock1.SendData sListing
End If
End Sub
What's really weird though it that on the same web site, using a different cgi script to post different data, it works.. Is it possible that the site can sense that it's coming via winsock as oppossed to a web browser and therefore are blocking my post?
Any help would be appreciated..
Dan