msabramo / requests-unixsocket

Use requests to talk HTTP via a UNIX domain socket
Apache License 2.0
207 stars 29 forks source link

session.post return None when server return http error code #68

Open jerryyyq opened 1 year ago

jerryyyq commented 1 year ago

session.post return None when server return http error code example curl get 400 code:

curl --unix-socket /tmp/.kavhttpd -i -X POST -H "Content-Type:application/json" -d '{"object":"/home/dpdk-17.11.1-3.10.0_693.el7.x86_64.aaarpm"}' http://localhost/api/v3.0/scanfile
HTTP/1.0 400 Bad Request
Connection: close
Content-Type: text/plain
Server: KAVHTTPD/1.0
X-KAV-ProtocolVersion: 3
Date: Mon, 03 Apr 2023 07:01:47 GMT
Content-Length: 42

{
    "error": "Cannot scan not a file"
}

At this scene, if use requests_unixsocket session to post, I get the return is None, I can't get the http response code or content..