0

In Ballerina HTTP client, we can send requests using the following syntax:

Album[] albums = check albumClient->/albums;

But if we need to send query parameters with this request like this:

albums?genre=pop

How can we do this with the above syntax?

ThisaruG
  • 3,222
  • 7
  • 38
  • 60

1 Answers1

1

This can be done similar to how you pass named parameters into a method:

Album[] albums = check albumClient->/albums(genre = pop);

See the relevant Ballerina By Example here.

ThisaruG
  • 3,222
  • 7
  • 38
  • 60