Am trying to send HTTP Get request with Content Type application/json via C#. but I don't find how to create this request. My HTTP request it's like this:
POST /messaging/registrations/(REGISTRATION_ID_FOR_DESTINATION_APP_INSTANCE)/messages HTTP/1.1
Host: api.amazon.com
Authorization: Bearer (MY_ACCESS_TOKEN)
Content-Type: application/json
X-Amzn-Type-Version: [email protected]
Accept: application/json
X-Amzn-Accept-Type: [email protected]
{
"data":{"key1":"value1","key2":"value2"},
"consolidationKey":"Some Key",
"expiresAfter":86400
}
Someone can help me, please. thinks for all.
Assuming you have a class like this to represent the payload,
you can use
HttpClient
, like this.