0

I have problem with sending POST request from .NET Core app when I added header Content-Type: application/x-ndjson. Without this header I have 400 error.

When I send the same request from Postman, with that header, all good and I have response.

When I removed header and add like this: new StringContent(content, Encoding.UTF8, "application/x-ndjson") I have 406 error(Not Acceptable)

Please, help me how I should send POST request from my app to retrieve data?

jps
  • 20,041
  • 15
  • 75
  • 79
Roma Pavliuk
  • 144
  • 8
  • What is the content string? Can you share the capture of the postman when sending the data? – Karney. Mar 19 '21 at 03:11
  • content is ndjson smth like this: {"preference":"Car"} {"query":{"bool":{"terms":{"color":"red"}}]}}} post request from postman with content-type "application/x-ndjson" works good. but how send this request from backend? – Roma Pavliuk Mar 19 '21 at 07:57

0 Answers0