Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Ask web api with several parameters using c#

$
0
0

Hi,

Hopefully this is the correct forum...
I want to call a get function in web api, with more than one criteria. I have this code in my shared universal app.

HttpClient test2 =newHttpClient();string res2 = await test2.GetStringAsync(newUri("http://localhost:56208/api/test/5"));
txtMyText.Text= res2;

I have this code in a web api controller.

publicstringGet(string id){return"Magnus value: "+id ;}

Now I want to send two parameters to the get function:

publicstringGet(string id,string name){return name+" value: "+id ;}

How do I accomplish that on the client side. Is the get function correct when using two or more in parameters?

BR /Magnus


Viewing all articles
Browse latest Browse all 4850


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>