Tools, FAQ, Tutorials:
Add Request Query String Parameters
How to add request query string Parameters to my Azure API operation to make it more user friendly?
✍: FYIcenter.com
If your API operation uses URL template parameters, the client system
must call it with parameter values specified in the correct position, like:
https://.../exchange-rate/USD/EUR/2020-10-10
The above URL is nice and short. But it confuses users: Is the rate for from USD to EUR or from EUR to UDS?
To avoid he confusion, you change the URL signature to use query string parameters, like
https://.../exchange-rate?from=USD&to=EUR&date=2020-10-10
One big advantage of query string parameters is that their position order is not important. So the following 3 URL are identical:
https://.../exchange-rate?from=USD&to=EUR&date=2020-10-10 https://.../exchange-rate?to=EUR&date=2020-10-10&from=USD https://.../exchange-rate?date=2020-10-10&from=USD&to=EUR
Here are steps to create query string parameters:
1. Go to the publisher portal of the API Management Service.
2. Open the "First API" and add a new operation "Get exchange rate #2".
3. Enter the following to create the operation:
Display name: Get Exchange Rate #2 Name: get-exchange-rate-2 HTTP verb: GET /exchange-rate Description: Get Exchange Rate #2
4. Click "Query" tab. You see parameter fields displayed.
5. Click "ADD QUERY PARAMETER" repeatedly to enter 3 parameters:
NAME DESCRIPTION TYPE VALUES REQUIRED from From-currency code string USD x to To-currency code string EUR x date Date of the order date 2020-10-10 x
The picture below shows you how to create request query string parameters for an API operation:
⇐ Add Request URL Template Parameters
2018-03-24, 4817🔥, 0💬
Popular Posts:
How To Move Uploaded Files To Permanent Directory in PHP? PHP stores uploaded files in a temporary d...
Where to find tutorials on Python programming language? I want to learn Python. Here is a large coll...
How to use the "send-one-way-request" Policy statement to call an extra web service for an Azure API...
How to install "C++/CLI Support" component in Visual Studio? I need to build my Visual Studio C++/CL...
How To Set session.gc_divisor Properly in PHP? As you know that session.gc_divisor is the frequency ...