Unsupported Media Type in postman

后端 未结 3 583
暖寄归人
暖寄归人 2021-01-03 18:17

I am implementing spring security with oauth2 and jwt. the below is my login function

function doLogin(loginData) {

    $.ajax({
        url :  back+\"/auth         


        
3条回答
  •  天命终不由人
    2021-01-03 18:40

    Http 415 Media Unsupported is responded back only when the content type header you are providing is not supported by the application.

    With POSTMAN, the Content-type header you are sending is Content type 'multipart/form-data not application/json. While in the ajax code you are setting it correctly to application/json. Pass the correct Content-type header in POSTMAN and it will work.

提交回复
热议问题