TCP POST Packet Problem

  • [autoit]

    Global $content = "k=" & $f_c & "&s=" & $k_c
    Global $packet = 'POST /upload.php HTTP/1.1' & @CRLF & _
    'Host: xxx' @CRLF & _
    'User-Agent: Mozilla/5.0' & @CRLF & _
    'Accept: text/html' & @CRLF & _
    'Accept-Language: de-de' & @CRLF & _
    'Content-Type: application/x-www-form-urlencoded' & @CRLF & _
    'Content-Length: ' & StringLen($content) & @CRLF & _
    $content & @CRLF & @CRLF

    [/autoit]

    Wenn ich es so abschick kommt keine Antwort. Was ist daran falsch?? ?(

    Einmal editiert, zuletzt von Ciber15 (21. April 2013 um 23:31)

  • 1. "Paket" schreibt man nur mit "k", nicht mit "ck". Das schreiben andauernd welche falsch hier.

    2. Könntest du bitte ein lauffähiges Skript hier hineinstellen, woran man dieses Problem nachvollziehen kann?

    MfG

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski

  • Ich glaub der Fehler liegt woanders.

    [autoit]

    TCPStartup()
    Global $host = "xx"
    Global $packet = 'POST /upload.php HTTP/1.1' & @CRLF & _
    'Host: ' & $host & @CRLF & _
    'User-Agent: Mozilla/5.0' & @CRLF & _
    'Accept: text/html' & @CRLF & _
    'Accept-Language: de-de' & @CRLF & _
    'Content-Type: application/x-www-form-urlencoded' & @CRLF & _
    'Content-Length: ' & StringLen($content) & @CRLF & _
    $content & @CRLF & @CRLF

    [/autoit][autoit][/autoit][autoit]

    Global $socket = TCPConnect(TCPNameToIp("xx"), 80)
    if @error Then
    MsgBox(16, "Fehler", "Verbinungsfehler")
    Exit
    EndIf
    TCPSend($socket, $packet)
    Global $recv, $r = false
    Global $timer = TimerInit()
    Do
    $recv = TCPRecv($socket, 1000)
    Until TimerDiff($timer)>1500

    [/autoit][autoit][/autoit][autoit]

    MsgBox(0, "", $recv)

    [/autoit]

    packet = english, paket = deutsch....

    Edit:
    Autsch, voll übersehen :cursing:
    $recv &= TCPRecv($socket, 1000) statt $recv = TCPRecv($socket, 1000)
    Trotzdem danke :thumbup:

  • Noch als Tipp: Du könntest das ganze auch über WinHTTP machen, kann dir morgen gerne ein Beispiel-Skript schreiben.

    MfG

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski