Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
DuniterPy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
27
Issues
27
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clients
python
DuniterPy
Commits
5a78d0ec
Commit
5a78d0ec
authored
Apr 03, 2017
by
inso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Aihttop 2
parent
f0f4313a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
duniterpy/api/bma/api.py
duniterpy/api/bma/api.py
+12
-12
requirements.txt
requirements.txt
+1
-1
No files found.
duniterpy/api/bma/api.py
View file @
5a78d0ec
...
...
@@ -159,18 +159,18 @@ class API(object):
:rtype: aiohttp.ClientResponse
"""
logging
.
debug
(
"Request : {0}"
.
format
(
self
.
reverse_url
(
self
.
connection_handler
.
http_scheme
,
path
)))
with
aiohttp
.
Timeout
(
15
):
url
=
self
.
reverse_url
(
self
.
connection_handler
.
http_scheme
,
path
)
response
=
await
self
.
connection_handler
.
session
.
get
(
url
,
params
=
kwargs
,
headers
=
self
.
headers
,
proxy
=
self
.
connection_handler
.
proxy
)
if
response
.
status
!=
200
:
try
:
error_data
=
parse_error
(
await
response
.
text
())
raise
DuniterError
(
error_data
)
except
(
TypeError
,
jsonschema
.
ValidationError
):
raise
ValueError
(
'status code != 200 =>
%
d (
%
s)'
%
(
response
.
status
,
(
await
response
.
text
())))
return
response
url
=
self
.
reverse_url
(
self
.
connection_handler
.
http_scheme
,
path
)
response
=
await
self
.
connection_handler
.
session
.
get
(
url
,
params
=
kwargs
,
headers
=
self
.
headers
,
proxy
=
self
.
connection_handler
.
proxy
,
timeout
=
15
)
if
response
.
status
!=
200
:
try
:
error_data
=
parse_error
(
await
response
.
text
())
raise
DuniterError
(
error_data
)
except
(
TypeError
,
jsonschema
.
ValidationError
):
raise
ValueError
(
'status code != 200 =>
%
d (
%
s)'
%
(
response
.
status
,
(
await
response
.
text
())))
return
response
async
def
requests_post
(
self
,
path
,
**
kwargs
):
"""
...
...
requirements.txt
View file @
5a78d0ec
aiohttp
<2.0
aiohttp
pylibscrypt
libnacl
base58
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment