Skip to content

Commit

Permalink
fix wrong examples in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebianchi committed Jan 26, 2023
1 parent be2fb0e commit 04cca69
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions docs/http_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ If error is not an http error, it is throw the error message and the error code.
## Examples

```js
// Example of a request towards `tokens-collection` endpoint passing through Microservice Gateway
async function tokenGeneration(request, response) {
const crudProxy = request.getServiceProxy()
const crudProxy = request.getHttpClient('http://my-service/base-path/')
const result = await crudProxy
.post('/tokens-collection/', {
id: request.body.quotationId,
Expand All @@ -84,21 +83,6 @@ async function tokenGeneration(request, response) {
}
```

```js
// and bypassing Microservice Gateway
async function tokenGeneration(request, response) {
const crudProxy = request.getDirectServiceProxy('crud-service')
const result = await crudProxy
.post('/tokens-collection/', {
id: request.body.quotationId,
valid: true
})

const tokens=result.payload;
// ...
}
```

:::note
The methods below are deprecated: switch to use the `getHttpClient` method.
:::
Expand Down

0 comments on commit 04cca69

Please sign in to comment.