Skip to content

Commit

Permalink
docs: clarify exec endpoint usage in http (#5202)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanFM committed Sep 23, 2022
1 parent 737875f commit 1399e36
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/fundamentals/gateway/index.md
Expand Up @@ -205,6 +205,26 @@ with:
- fine-tuning
```
````

However, if you want to send requests to a different Executor endpoint, you can still do it without exposing it in the HTTP endpoint, by sending an HTTP request to the `/post` HTTP endpoint while setting
`execEndpoint` in the request.

```text
curl --request POST \
'http://localhost:12345/post' \
--header 'Content-Type: application/json' -d '{"data": [{"text": "hello world"}], "execEndpoint": "/foo"}'
```

The above cURL command is equivalent to passing the `on` parameter to `client.post` as follows:

```python
from docarray import DocumentArray, Document
from jina import Client

client = Client(port=12345, protocol='http')
client.post(on='/foo', inputs=DocumentArray([Document(text='hello world')]))
```

### Hide default endpoints

It is possible to hide the default CRUD and debug endpoints in production. This might be useful when the context is not applicable.
Expand Down

0 comments on commit 1399e36

Please sign in to comment.