Skip to content

Commit

Permalink
Update READme with latest version of api generation
Browse files Browse the repository at this point in the history
  • Loading branch information
erewok committed Feb 13, 2017
1 parent 542e575 commit 3c33a28
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ main = writePythonForAPI testApi requests (result </> "api.py")
If you build the above and run it, you will get some output that looks like the following:

```python

from urllib import parse

import requests
Expand All @@ -92,23 +91,23 @@ def post_counterreqheader():
POST "counter-req-header"
"""
url = "/counter-req-header"
url = "http://localhost:8000/counter-req-header"

resp = requests.post(url)
resp.raise_for_status()
return resp.json()


def get_counterqueryparam(sortby, header_SomeHeader):
def get_counterqueryparam(sortby, headerSomeHeader):
"""
GET "counter-queryparam"
"""
url = "/counter-queryparam"
url = "http://localhost:8000/counter-queryparam"

headers = {"Some-Header": headerSomeHeader}
params = {"sortby": sortby}
resp = requests.get(url
resp = requests.get(url,
headers=headers,
params=params)

Expand All @@ -121,10 +120,10 @@ def get_loginqueryflag(published):
GET "login-queryflag"
"""
url = "/login-queryflag"
url = "http://localhost:8000/login-queryflag"

params = {"published": published}
resp = requests.get(url
resp = requests.get(url,
params=params)

resp.raise_for_status()
Expand All @@ -136,10 +135,10 @@ def post_loginparamsauthorswithreqBody(authors, data):
POST "login-params-authors-with-reqBody"
"""
url = "/login-params-authors-with-reqBody"
url = "http://localhost:8000/login-params-authors-with-reqBody"

params = {"authors": authors}
resp = requests.post(url
resp = requests.post(url,
params=params,
json=data)

Expand All @@ -155,12 +154,12 @@ def post_loginwithpathvarandheader_by_id_by_Name_by_hungrig(id, Name, hungrig, d
Name
hungrig
"""
url = "/login-with-path-var-and-header/{id}/{Name}/{hungrig}".format(
url = "http://localhost:8000/login-with-path-var-and-header/{id}/{Name}/{hungrig}".format(
id=parse.quote(id),
Name=parse.quote(Name),
hungrig=parse.quote(hungrig))

resp = requests.post(url
resp = requests.post(url,
json=data)

resp.raise_for_status()
Expand Down

0 comments on commit 3c33a28

Please sign in to comment.