Skip to content

Examples

Talk is cheap. Show me the code!

Below there are some implementation examples

[HttpPost]
public HttpResponseMessage V3([FromBody] dynamic json) // Do not use dynamic type, this is for example purposes only
{
var containers = new List<object>
{
new
{
Type = "MESSAGE",
Phrase = json.value,
},
};
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.Headers.Add("Authorization", Request.Headers.Authorization.ToString());
var responseContent = new
{
success = true,
message = "",
containers
};
response.Content = new StringContent(JsonConvert.SerializeObject(responseContent), Encoding.UTF8, "text/plain");
return response;
}