From 04cca696fe47625ccca162d0f1263adb77fcd436 Mon Sep 17 00:00:00 2001 From: Davide Bianchi Date: Thu, 26 Jan 2023 11:01:49 +0100 Subject: [PATCH] fix wrong examples in docs --- docs/http_client.md | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/docs/http_client.md b/docs/http_client.md index 2febdba..292ab59 100644 --- a/docs/http_client.md +++ b/docs/http_client.md @@ -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, @@ -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. :::