Skip to content

Commit

Permalink
Merge pull request #488 from skalish/docs-passing-json
Browse files Browse the repository at this point in the history
docs(tuc): add detail to passing json body in custom endpoint documentation
  • Loading branch information
pcattori committed May 5, 2021
2 parents f24503f + 23a4666 commit 691c162
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Expand Up @@ -3,6 +3,6 @@ pandas==1.0.5
recommonmark==0.6.0
sphinx_rtd_theme==0.5.0
sphinx-autodoc-typehints==1.11.0
Sphinx==3.1.1
Sphinx==3.5.4
toml==0.10.0
.
10 changes: 10 additions & 0 deletions docs/user-guide/advanced-usage.md
Expand Up @@ -53,6 +53,16 @@ methods:
response = tamr.get('relative/path/to/resource')
```

Request headers and data can be supplied by passing dictionaries or lists with the `headers` and `json` arguments:

```python
# e.g. `post` with headers and data
headers = {...}
body = {...}

response = tamr.post('relative/path/to/resource', headers=headers, json=body)
```

### Custom Host / Port / Base API path

If you need to repeatedly send requests to another port or base API path (i.e. not `/api/versioned/v1/`), you can simply instantiate a different client.
Expand Down

0 comments on commit 691c162

Please sign in to comment.