Streaming API blocking

I’ve been updating my Python launcher API wrapper to 0.5 and I’m having some trouble with the new streaming APIs.

I’ve updated my code to use the streaming feature of requests. Unfortunately this blocks on the request not allowing me to access the raw socket underneath.

I’ve also tried sending the files in the initial request:

with open('/home/will/test.html', 'rb') as f:
    r = requests.post(url,
        data=f,
        headers=headers,
        stream=True)

This returns an error:

res.status is not a function
    at file:///home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/app.js:2206:11
    at Layer.handle [as handle_request] 
(/home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix 
(/home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/index.js:312:13)
    at /home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/index.js:280:7
    at Function.process_params 
(/home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/index.js:330:12)
    at next 
(/home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/index.js:271:10)
    at file:///home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/app.js:2196:16
    at Layer.handle_error 
(/home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix 
(/home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/index.js:310:13)
    at /home/will/Downloads/safe_launcher-v0.6.0-linux-x64/resources/app.asar/node_modules/express/lib/router/index.js:280:7

Unfortunately my knowledge of node.js and javascript is too small to debug this.

I understand the API documentation will be updated soon but was wondering if anyone else had managed to get this working.

6 Likes