requests-unixsocket icon indicating copy to clipboard operation
requests-unixsocket copied to clipboard

session.post return None when server return http error code

Open jerryyyq opened this issue 2 years ago • 0 comments

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..

jerryyyq avatar Apr 03 '23 07:04 jerryyyq