Hi,
How can I use GetAsync with passing a content like this:
var response = await client.GetAsync("https://onesignal.com/api/v1/notifications", content);
Thanks
Hi,
How can I use GetAsync with passing a content like this:
var response = await client.GetAsync("https://onesignal.com/api/v1/notifications", content);
Thanks
I'll assume you are referring to the HttpClient. There's no content in an HTTP GET request. Are you trying to send a POST; PostAsync???
As AgaveJoe said, if you want to use GetAsync with parameters, you can have a try like this
var response = await client.GetAsync("https://onesignal.com/api/v1/notifications?content="your content"&key1=value1&key2=value2");
HTTP GET submits parameters in the URL and does not have a body like POST. For example...
https://onesignal.com/api/v1/notifications?id=1&msg=hello
Parameter can also exist as part of the URL. In Web API these are called route parameters and match a configured pattern.
https://onesignal.com/api/v1/notifications/1/hello
You'll need to read the API documentation to understand how to format the URL.
9 people are following this question.