I have the following class defined:
public class Ticket
{
public string name
public string content
public int itilcategories_id
}
And the following code sample:
static HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://stgsd.primaverabss.com/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
ticket.name = "TESTE";
ticket.content = "teste";
ticket.itilcategories_id = 1
HttpResponseMessage response = await client.PostAsync("apirest.php/Ticket/", XXXXXXXXX );
My goal is to replace the XXXXXXX that are in the PostAsync so that in its place pass the information of the Ticket and that when sending to the respective link the content is the following:
{"input":[{"name": "TESTE", "content": "teste", "itilcategories_id":"1"}]}
Any ideas? Any questions please let me know !!