415 Unsupported media type only through Fuel
See original GitHub issueHi, I have a server I am trying to reach to. If I open a browser and simply enter the url of my endpoint, I can see the response. If I use curl curl localhost:9090/api/some-get-endpoint
I can see the response. Even when I try it in Postman, and create a simple GET request, it works. But if I try to reach the server using Fuel I get 415 Unsupported Media Type
.
This is the code I am running:
FuelManager.instance.basePath = "http://$host:$port/api"
"/position"
.httpGet()
.responseString(handler).join()
And the full error:
HTTP Exception 415 Unsupported Media Type
com.github.kittinunf.fuel.core.FuelError$Companion.wrap(FuelError.kt:84)
com.github.kittinunf.fuel.core.FuelError$Companion.wrap$default(FuelError.kt:83)
com.github.kittinunf.fuel.core.requests.RequestTaskCallbacks.call(RequestTaskCallbacks.kt:30)
com.github.kittinunf.fuel.core.requests.RequestTaskCallbacks.call(RequestTaskCallbacks.kt:20)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
Caused by: HTTP Exception 415 Unsupported Media Type
com.github.kittinunf.fuel.core.FuelError$Companion.wrap(FuelError.kt:86)
Caused by: com.github.kittinunf.fuel.core.HttpException: HTTP Exception 415 Unsupported Media Type
com.github.kittinunf.fuel.core.requests.RequestTask.prepareResponse(RequestTask.kt:35)
com.github.kittinunf.fuel.core.requests.RequestTask.call(RequestTask.kt:47)
com.github.kittinunf.fuel.core.requests.RequestTask.call(RequestTask.kt:14)
com.github.kittinunf.fuel.core.requests.RequestTaskCallbacks.call(RequestTaskCallbacks.kt:28)
com.github.kittinunf.fuel.core.requests.RequestTaskCallbacks.call(RequestTaskCallbacks.kt:20)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
I am sure I am missing something stupid, but I don’t see what…
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
HTTP Status 415 - Unsupported Media Type when doing POST
My code and part of the screen shot is included, the pair for the hashmap I tried is duration and 150 . I...
Read more >415 Unsupported Media Type - KeyCDN Support
A 415 Unsupported Media Type error occurs when the origin server refuses a particular request since the resource is in a format that...
Read more >esriRequest returnes "415 Unsupported media type"
esriRequest returnes "415 Unsupported media type" with js aspi 4.12. 337. 1. 07-16-2019 03:16 AM. deleted-user-OOe4JK-9Abnm. by deleted-user-OOe4JK-9Abnm.
Read more >415 Unsupported MediaType in Spring Application - Baeldung
There are two options in front of us to resolve the issue. The first option is to change the request payload format according...
Read more >Connection with API error code 415: Unsupported Media Type
try hardcoding Name Content-Type with a Value of application/problem+json in your header tab in the download tool. my usual strategy is run in ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I swapped to kohttp, the problem is gone. If you want to further investigate the issue with Fuel I was using version
2.2.3
and then I swapped to the latest2.3.0
. Both of them were buggy for me.I will try to fork the C++ and see what is going on there. Sorry! and Thanks for the report! 🙇