Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
748d1a00
Commit
748d1a00
authored
Oct 30, 2018
by
J. Fernando Sánchez
Browse files
Fix bug in POST
parent
a82e4ed4
Changes
2
Hide whitespace changes
Inline
Side-by-side
senpy/blueprints.py
View file @
748d1a00
...
@@ -69,7 +69,7 @@ def encoded_url(url=None, base=None):
...
@@ -69,7 +69,7 @@ def encoded_url(url=None, base=None):
if
request
.
method
==
'GET'
:
if
request
.
method
==
'GET'
:
url
=
request
.
full_path
[
1
:]
# Remove the first slash
url
=
request
.
full_path
[
1
:]
# Remove the first slash
else
:
else
:
hash
(
frozenset
(
request
.
parameters
.
items
()))
hash
(
frozenset
(
tuple
(
request
.
parameters
.
items
()))
)
code
=
'hash:{}'
.
format
(
hash
)
code
=
'hash:{}'
.
format
(
hash
)
code
=
code
or
base64
.
urlsafe_b64encode
(
url
.
encode
()).
decode
()
code
=
code
or
base64
.
urlsafe_b64encode
(
url
.
encode
()).
decode
()
...
...
senpy/client.py
View file @
748d1a00
...
@@ -25,7 +25,11 @@ class Client(object):
...
@@ -25,7 +25,11 @@ class Client(object):
def
request
(
self
,
path
=
None
,
method
=
'GET'
,
**
params
):
def
request
(
self
,
path
=
None
,
method
=
'GET'
,
**
params
):
url
=
'{}{}'
.
format
(
self
.
endpoint
.
rstrip
(
'/'
),
path
)
url
=
'{}{}'
.
format
(
self
.
endpoint
.
rstrip
(
'/'
),
path
)
response
=
requests
.
request
(
method
=
method
,
url
=
url
,
params
=
params
)
if
method
==
'POST'
:
response
=
requests
.
post
(
url
=
url
,
data
=
params
)
else
:
response
=
requests
.
request
(
method
=
method
,
url
=
url
,
params
=
params
)
try
:
try
:
resp
=
models
.
from_dict
(
response
.
json
())
resp
=
models
.
from_dict
(
response
.
json
())
except
Exception
as
ex
:
except
Exception
as
ex
:
...
...
Write
Preview
Supports
Markdown
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