[英]How to fix cur error: could not resolve host error
I'm learning networks (socket lib in python) and have a problem.我正在学习网络(python 中的套接字库)并且遇到了问题。 When I make a request to this app answer on this request is an error: "Could not resolve host: POST"
当我向此应用发出请求时,此请求的答案是错误:“无法解析主机:POST”
Here is my code这是我的代码
import socket
sock = socket.socket()
sock.bind(('',9091))
print("DATABASE INITED")
while True:
sock.listen(1)
connection, address = sock.accept()
buf = connection.recv(64)
if len(buf) > 0:
print(buf)
conn.send(buf.upper())
conn.close()
And here is code to curl request这是卷曲请求的代码
curl -d "data = 'example'" POST 127.0.0.1:9091
Query and program located on the one Linux computer.位于一台 Linux 计算机上的查询和程序。
尝试这个:
curl --data "data = 'example'" 127.0.0.1:9091
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.