Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
c56d6d6b
Commit
c56d6d6b
authored
Jul 08, 2016
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs tweaks
parent
7c171dfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
docs/topics/api-clients.md
+15
-4
No files found.
docs/topics/api-clients.md
View file @
c56d6d6b
...
@@ -58,12 +58,14 @@ exposes a supported schema format.
...
@@ -58,12 +58,14 @@ exposes a supported schema format.
To install the Core API command line client, use
`pip`
.
To install the Core API command line client, use
`pip`
.
$ pip install coreapi
Note that the command-line client is a separate package to the
python client library
`coreapi`
. Make sure to install
`coreapi-cli`
.
$ pip install coreapi-cli
To start inspecting and interacting with an API the schema must first be loaded
To start inspecting and interacting with an API the schema must first be loaded
from the network.
from the network.
$ coreapi get http://api.example.org/
$ coreapi get http://api.example.org/
<Pastebin API "http://127.0.0.1:8000/">
<Pastebin API "http://127.0.0.1:8000/">
snippets: {
snippets: {
...
@@ -120,7 +122,14 @@ To inspect the underlying HTTP request and response, use the `--debug` flag.
...
@@ -120,7 +122,14 @@ To inspect the underlying HTTP request and response, use the `--debug` flag.
Some actions may include optional or required parameters.
Some actions may include optional or required parameters.
$ coreapi action users create --params username example
$ coreapi action users create --param username=example
When using
`--param`
, the type of the input will be determined automatically.
If you want to be more explicit about the parameter type then use
`--data`
for
any null, numeric, boolean, list, or object inputs, and use
`--string`
for string inputs.
$ coreapi action users edit --string username=tomchristie --data is_admin=true
## Authentication & headers
## Authentication & headers
...
@@ -195,7 +204,9 @@ API that exposes a supported schema format.
...
@@ -195,7 +204,9 @@ API that exposes a supported schema format.
## Getting started
## Getting started
You'll need to install the
`coreapi`
package using
`pip`
before you can get
You'll need to install the
`coreapi`
package using
`pip`
before you can get
started. Once you've done so, open up a python terminal.
started.
pip install coreapi
In order to start working with an API, we first need a
`Client`
instance. The
In order to start working with an API, we first need a
`Client`
instance. The
client holds any configuration around which codecs and transports are supported
client holds any configuration around which codecs and transports are supported
...
...
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