Closed Slugger closed 4 years ago
Thank you for reporting this mate, I have now fixed it. It will be available on the next release (tonight):
With a TCP listener on port 7000, I ran the following test:
ScripterX.Web.JsonPost("http://localhost:7000/hook.php", "test");
and the TCP listener now captures the correct request format:
Listening on tcp port 7000 Client connected POST /hook.php HTTP/1.1 Host: localhost:7000 Accept: application/json User-Agent: Emby Server/4.4.3.0 Accept-Encoding: deflate Content-Type: application/json Content-Length: 4
test Client disconnected
fix is good
Describe the bug When using
ScripterX.Web.JsonPost()
, the request that gets sent includes an invalid Accept header. The header being sent in the request is:Accept: Accept application/json
It should just be:
Accept: application/json
To Reproduce Steps to reproduce the behavior:
JsonPost()
to an endpoint that enforces the Accept header content typeEndpoint will return an Invalid Media Type http error in response.
Expected behavior Proper accept header sent in request so that the endpoint can return a response
Desktop (please complete the following information): n/a
Smartphone (please complete the following information): n/a
Additional context Add any other context about the problem here.