skip to Main Content

Json – C# Not able to post data using HttpRequestMessage and getting 400 status

I tried a few different ways I can't get pipelineId to post (receive 400), see code below: { client.BaseAddress = new Uri(_serviceConfig.DataGapsBaseUrl); var request = new HttpRequestMessage(HttpMethod.Post, "/piper/jobs"); var jsonContent = new StringContent(JsonConvert.SerializeObject(new { pipelineId = _serviceConfig.DataPipelineId }), Encoding.UTF8, "application/json");…

VIEW QUESTION

I try API request post with body type raw to get a token but need understand what is wrong – Asp.net

My method to get tokenKey is : HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(url); httpRequest.Method = "POST"; httpRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 OPR/52.0.2871.99"; string tokenResponse = null; HttpClient client = new HttpClient(); HttpResponseMessage response…

VIEW QUESTION
Back To Top
Search