Skip to content
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

Merge v0.2.x test #69

Open
wants to merge 3 commits into
base: v0.2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions amostra/client/amutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import ujson


session = requests.Session()


def doc_or_uid_to_uid(doc_or_uid):
"""Given Document or uid return the uid

Expand Down Expand Up @@ -38,7 +41,7 @@ def _get(url, params):
Results of the query

"""
r = requests.get(url, ujson.dumps(params))
r = session.get(url, params=ujson.dumps(params))
r.raise_for_status()
return ujson.loads(r.text)

Expand All @@ -54,7 +57,7 @@ def _post(url, data):
Entries to be inserted to database

"""
r = requests.post(url,
r = session.post(url,
data=ujson.dumps(data))
r.raise_for_status()
return r.json()
Expand Down Expand Up @@ -83,6 +86,6 @@ def _put(url, query, update):

"""
update_cont = {'query': query, 'update': update}
r = requests.put(url,
r = session.put(url,
data=ujson.dumps(update_cont))
r.raise_for_status()
Loading