Register multiple services via PUT request

Hi,

I’m newbie who struggling to compose correct JSON-payload file with 2 services.
The docs is not correct there, I’m getting error Request decode failed: json: unknown field "services".

Is it even possible to achieve in version 1.8.5?
Will be glad for any help and suggestions.

Hi @dshatohin,

This method of registering multiple services is only supported when using the configuration files.

You’ll have to individually register services when using the API endpoint.

1 Like

Ok, now I know the truth :upside_down_face:
Thank you!

Hi @blake,

I stumbled upon this as well today, because it’s not stated explicitly here:

https://www.consul.io/docs/discovery/services#multiple-service-definitions

I created a PR to highlight the difference between config file and HTTP API. PTAL:

1 Like