Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit f5e7ba8

Browse files
authored
Merge pull request #215 from NervanaSystems/amit/service_curl_doc
Service Doc - added CURL run example
2 parents 5cd8bf5 + 87d15a4 commit f5e7ba8

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

doc/source/service.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ Otherwise the expected Request for the server is the following:
5353
]
5454
}
5555
56-
If you wish the response format will be Json / Gzip format, please specify it under "Response-Format"
57-
header (Response-Format=json\gzip). The default response format is Json.
56+
Request Headers
57+
---------------
58+
59+
- Content-Type: "application/json" or "application/gzip"
60+
61+
- Response-Format: The response format, "json" or "gzip". The default response format is json.
5862

5963
The server supports 2 types of Responses (see `Annotation Structure Types - Server Responses` bellow).
6064

@@ -88,6 +92,23 @@ to `http://localhost:8080/spacy_ner`, and receive `HighLevelDoc` annotation stru
8892
8993
You can also take a look at the tests (tests/nlp_architect_server) to see more examples.
9094

95+
Example CURL request
96+
--------------------
97+
98+
Running `spacy_ner` model
99+
100+
.. code:: json
101+
102+
curl -i -H "Response-Format:json" -H "Content-Type:application/json" -d '{"docs": [{"id": 1,"doc": "Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, in the Silicon Valley."}]}' http://{localhost_ip}:8080/spacy_ner
103+
104+
105+
Running `bist` model
106+
107+
.. code:: json
108+
109+
curl -i -H "Response-Format:json" -H "Content-Type:application/json" -d '{"docs":[{"id": 1,"doc": "Time flies like an arrow. fruit flies like a banana."},{"id": 2,"doc": "the horse passed the barn fell"},{"id": 3,"doc": "the old man the boat"}]}' http://10.13.133.120:8080/bist
110+
111+
91112
Annotation Structure Types - Server Responses
92113
=============================================
93114
The server supports 2 types of annotation structure (responses from the server):

0 commit comments

Comments
 (0)