Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4115

Dev Please help the C# RestSharp POST not working [closed]

$
0
0

Please help the below C# code with RestSharp POST not working is there something missing below URL works well with PostMan. Debugging info added.enter image description hereenter image description here

    payloadStr = """        {"data": {"query": "","page": 0,"hitsPerPage": 8,"filters": "category.key: 'delistings'"          }        }""";postUrl = "/announcements/api/search/v1/index/announcement-posts_en";string URL = "https://api2.bybit.com";var options = new RestClientOptions(URL); var client = new RestClient(options);var request = new RestRequest(postUrl);request.AddParameter("application/json", payloadStr, ParameterType.RequestBody);request.RequestFormat = DataFormat.Json;var response = await client.PostAsync(request);if (response.StatusCode == HttpStatusCode.OK){    dynamic oResponse = JsonConvert.DeserializeObject(response.Content);    responseData = response.Content;}

Viewing all articles
Browse latest Browse all 4115

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>