-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple protocol https: appended request.url in client.request #109
Comments
market_order_operation is actually (pyswagger.Request, pyswagger.Response), which is only for one-time usage. So based on current design, you need to call app.op'xxxxx' again to get another pair of (pyswagger.Request, pyswagger.Response) for next request. To make it reusable, i need to add a "prepared" flag in pyswagger.Request, and reset what cached in pyswagger.Response. |
Thank you for your quick response. I really appreciate it. I can confirm that recalling:
And recalling
Does work. This is a nice work around and I would be nice to make it reusable Thank you again. |
- this happens when reusing (req, resp) - add reset method to both Request, Response - calling reset in all builtin client - #109
This issue is fixed for all builtin clients and would be available in next release. You could reuse what returned from Operation.call anytime you want. fix is included in v0.8.27. |
- this happens when reusing (req, resp) - add reset method to both Request, Response - calling reset in all builtin client - pyopenapi/pyswagger#109
[fix] - using App.create(<url>) with HTTPS, auth, and custom headers? pyopenapi/pyswagger#107 - multiple protocol https: appended request.url in client.request pyopenapi/pyswagger#109 [new] - add pyswagger.getter.SimpleGetter - pyswagger.io.Request and pyswagger.io.Response has reset(), and could be reused.
Not sure how to describe this issue since I've very new to using pyswagger.
When I run client.request multiple times, the first time it runs fine, each successive time an https: gets appended to the URL.
Here's a reproducible scenario and hopefully you can tell me where I'm going wrong
In [28]: item_order.status
Out[28]: 200
This runs fine.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Now just call the client.request again and an https: is appended to the URL
/usr/local/lib/python2.7/dist-packages/pyswagger-0.8.26-py2.7.egg/pyswagger/contrib/client/requests.pyc in request(self, req_and_resp, opt)
62 )
63 rq = self.__s.prepare_request(rq)
---> 64 rs = self.__s.send(rq, stream=True, **self.__send_opt)
65
66 resp.apply_with(
/usr/lib/python2.7/dist-packages/requests/sessions.pyc in send(self, request, **kwargs)
551
552 # Get the appropriate adapter to use
--> 553 adapter = self.get_adapter(url=request.url)
554
555 # Start time (approximately) of the request
/usr/lib/python2.7/dist-packages/requests/sessions.pyc in get_adapter(self, url)
596
597 # Nothing matches :-/
--> 598 raise InvalidSchema("No connection adapters were found for '%s'" % url)
599
600 def close(self):
InvalidSchema: No connection adapters were found for https:https://esi.tech.ccp.is/latest/markets/10000002/orders/?type_id=34&order_type=all&page=1&datasource=tranquility'
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Now just call the client.request a 3rd time https:https: is appended to the URL
InvalidSchema Traceback (most recent call last)
in ()
----> 1 client.request(market_order_operation)
/usr/local/lib/python2.7/dist-packages/pyswagger-0.8.26-py2.7.egg/pyswagger/contrib/client/requests.pyc in request(self, req_and_resp, opt)
62 )
63 rq = self.__s.prepare_request(rq)
---> 64 rs = self.__s.send(rq, stream=True, **self.__send_opt)
65
66 resp.apply_with(
/usr/lib/python2.7/dist-packages/requests/sessions.pyc in send(self, request, **kwargs)
551
552 # Get the appropriate adapter to use
--> 553 adapter = self.get_adapter(url=request.url)
554
555 # Start time (approximately) of the request
/usr/lib/python2.7/dist-packages/requests/sessions.pyc in get_adapter(self, url)
596
597 # Nothing matches :-/
--> 598 raise InvalidSchema("No connection adapters were found for '%s'" % url)
599
600 def close(self):
InvalidSchema: No connection adapters were found for https:https:https://esi.tech.ccp.is/latest/markets/10000002/orders/?type_id=34&order_type=all&page=1&datasource=tranquility'
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Each time you run client.request another https: gets appended
The text was updated successfully, but these errors were encountered: