Passing Path Parameters in Ballerina HTTP Client

43 Views Asked by At

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

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

But if we need to bind a variable as a path parameter, how to do that?

string albumId = "123";
Album[] albums = check albumClient->/albums/123;

How can I set the value dynimacally?

1

There are 1 best solutions below

0
shayanmalinda On

It works as

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