In my application, I am sending request with okhttp3 and retrofit2 . Here is I logged the request by HttpLoggingInterceptor
:
okhttp3.OkHttpClient: --> POST https://something/here http/1.1
okhttp3.OkHttpClient: Content-Type: application/json; charset=UTF-8
okhttp3.OkHttpClient: Content-Length: 2596
okhttp3.OkHttpClient: --> END POST (2596-byte body)
And I have this in my server:
@Consumes("application/json; charset=UTF-8")
Currently, Keep getting HTTP 415 error code.
Environment:
Not only the @Produce type should match the @Consumes type, but also the @Body should be completely matched.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.