how python http request and response works

前端 未结 3 1576
逝去的感伤
逝去的感伤 2021-02-09 13:56

I\'m newbie for python, I\'m having task so I need to scan wifi and send the data to the server, the below is the format which i have to send, this work fine when enter manually

3条回答
  •  一个人的身影
    2021-02-09 14:54

    Instead of:

    conn = httplib.HTTPConnection("http://223.56.124.58:8080/wireless")
    conn.request("POST", "data", params, headers)  
    

    try:

    conn = httplib.HTTPConnection("223.56.124.58", port=8080)
    conn.request("POST", "/wireless", params, headers)
    

    Not sure if it will resolve all your problems, but at least your code will conform to the method/constructor signatures.

提交回复
热议问题