I am trying to send some form data to a spring application using Fetch API in javascript. I have this code to send the form data: but i get a 415 status error “Unsupported Media Type”. Even when i set specifically the header ‘Content-Type’ to ‘application/json’ it sends like ‘text/plain’ this is the response that i get from the server:
Tag: fetch
Cache-Control : no-cache
I tried to build an app in android studio which does json parsing from a URL server with ports (example: http://xxx.xxx.xxx.xxx:xxxx). So I found 3 methods such as asynctask, volley and okhttp. But the problem is everytime I parse it with these methods, the same exception always occurred. java.net.ProtocalException: Unexpected status line: HTTP/1.1 Cache-Control:no-cache Here is my code So is