Results 1 to 3 of 3

Thread: winsock problems..

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    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

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Can you post the code that posts via Winsock?
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width