Comments (4)
Hi @ryandigital,
I need more context to reproduce this bug here:
- python version
- python-simple-rest-client version
- the code that you try to execute
from python-simple-rest-client.
Python 3.6.4
python-simple-rest-client version the latest
and trying to get error message in a try catch manner
from python-simple-rest-client.
I can't reproduce this error here.
Here is my code:
# test.py file
from simple_rest_client.api import API
from simple_rest_client.exceptions import NotFoundError
httpbin_api = API(api_root_url='https://httpbin.org/')
httpbin_api.add_resource(resource_name='not_found_resource')
try:
httpbin_api.not_found_resource.list()
except NotFoundError as exc:
print('Not Found, error={!r}'.format(exc))
python test.py
Not Found, error=NotFoundError('operation=not_found_error, response=Response(url=\'https://httpbin.org/not_found_resource\', method=\'GET\', body=\'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\\n<title>404 Not Found</title>\\n<h1>Not Found</h1>\\n<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>\\n\', headers={\'Connection\': \'keep-alive\', \'Server\': \'meinheld/0.6.1\', \'Date\': \'Fri, 16 Mar 2018 02:26:51 GMT\', \'Content-Type\': \'text/html\', \'Content-Length\': \'233\', \'Access-Control-Allow-Origin\': \'*\', \'Access-Control-Allow-Credentials\': \'true\', \'X-Powered-By\': \'Flask\', \'X-Processed-Time\': \'0\', \'Via\': \'1.1 vegur\'}, status_code=404, client_response=<Response [404]>)', Response(url='https://httpbin.org/not_found_resource', method='GET', body='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>404 Not Found</title>\n<h1>Not Found</h1>\n<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>\n', headers={'Connection': 'keep-alive', 'Server': 'meinheld/0.6.1', 'Date': 'Fri, 16 Mar 2018 02:26:51 GMT', 'Content-Type': 'text/html', 'Content-Length': '233', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': 'true', 'X-Powered-By': 'Flask', 'X-Processed-Time': '0', 'Via': '1.1 vegur'}, status_code=404, client_response=<Response [404]>))
from python-simple-rest-client.
worked thanks a million
from python-simple-rest-client.
Related Issues (20)
- Resource names with dash HOT 1
- Extending resource default actions HOT 1
- File upload example
- Authentication request HOT 2
- Looks like json encoder uses huge amount of memory
- New httpx v0.8.0 breaks library
- Authentication HOT 1
- Dash in resource name: Mangling of resource names in add_resource() breaks compatibility HOT 2
- Feature request: Support docstring
- New httpx 0.12.1 breaks simple rest client
- feature request : Support for OAuth based authentication for API client
- Incorrect exception caught on timeout
- json_encode_body cannot be overridden if True in API HOT 2
- Handle connection refused exception
- Proxy Error 503
- Posibility to disable timeout?
- Question about concurrent requests limit
- add custom user agent feature
- suggestion regarding async HOT 3
- Incompatible with httpx>=0.19.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-simple-rest-client.