JavaScript 용 angular2를 사용해 본 결과 Http.get
요청을 할 수 있었지만 Http.post
요청을 시도했을 때 415 Unsupported Media Type
오류가 발생했습니다. 415 지원되지 않는 미디어 유형 angular2
코드 자체
꽤 간결, 그래서 나는이 오류의 원인이 될 수 있는지 확실하지 않았다. 이 문제를 어떻게 해결할 수 있습니까?var headers = new Headers();
headers.append('Content-Type', 'application/json');
console.log(headers.get('Content-Type'))
return this.http.post(this.endpoint_url, data="test.json", headers=headers).subscribe(
function(response){console.log("Success Response" + response)},
function(error){console.log("Error happened : " + error)});
415 거의 확실히 뭔가 서버에 의해 반환됩니다. – Harangue