GetAsync with content

Jassim Al Rahma 1,571 Reputation points
2021-07-21T20:04:50.527+00:00

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

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,354 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,936 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AgaveJoe 28,371 Reputation points
    2021-07-21T22:12:58.807+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.