2017-04-19 5 views
0

안녕 내 플레이 프레임 워크 응용 프로그램이플레이 프레임 워크는 415 (지원되지 않는 미디어 유형)

415 (Unsupported Media Type) 

후 반환 반환 보이는 THOD 게시물에 대한

fetch(API_URL+'/process', { 
     method: "POST", 
     header: {"contentType": "application/json;charset=utf-8"}, 
     body: JSON.stringify(newProcess) 
    }); 

컨트롤러 코드와 같은 :

@BodyParser.Of(BodyParser.Json.class) 
public Result createProcess(){ 

    System.out.println("TEST"); 
    System.out.println(request().body()); 

뭐가 문제 야?

답변

2

그것은 당신이 잘못된 헤더 를 설정하는 것,이 시도 :

fetch(API_URL + '/process', { 
    method: 'POST', 
    headers: { 'Content-Type': 'application/json' }, 
    body: JSON.stringify(newProcess) 
}); 
관련 문제