Skip to content

Commit

Permalink
Merge e73a3cb into 26eb47d
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioNappi committed Mar 13, 2023
2 parents 26eb47d + e73a3cb commit 5a1f28b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/http_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ You can call any service or any endpoint defined on the Platform project, obtain

For example, if you need to connect to a CRUD, you have to use a Proxy towards the `crud-service`.

You can get a proxy calling these methods both on `Request`(the first argument of handler) and `Service` (the Fastify instance):
You can get a proxy calling these methods both on `Request` (the first argument of handler) and `Service` (the Fastify instance):

* `getHttpClient(baseURL, options)` - returns an http client configured with the given base URL and options.
* `baseURL` - the base URL of the service, with protocol, host and it is possible to add a base prefix. The prefix must ends with a slash. Keep in mind that in method functions you must start the path without slash if you want to reuse the path prefix.
Expand All @@ -20,7 +20,7 @@ You can get a proxy calling these methods both on `Request`(the first argument o

Potentially, the `getHttpClient` method allows you to also query services outside the Platform. In this case, however, it is necessary to bear in mind that the platform headers will be automatically forwarded. You can do it by setting the `isMiaHeaderInjected` option value to false.

The http client by default forward the four Mia headers to the service called. In addition, other headers of the original request can also be forwarded to the named service. To do this it is necessary to define an additional environment variable, `ADDITIONAL_HEADERS_TO_PROXY`, whose value must be a string containing the keys of the headers to be forwarded separated by a comma.
The http client created from the Request by default forwards the four Mia headers to the service called. In addition, other headers of the original request can also be forwarded to the named service. To do this it is necessary to define an additional environment variable, `ADDITIONAL_HEADERS_TO_PROXY`, whose value must be a string containing the keys of the headers to be forwarded separated by a comma.

The client expose the methods to perform a specific HTTP request to service.

Expand Down

0 comments on commit 5a1f28b

Please sign in to comment.