내가컨텐츠 형의 몸을 구문 분석하는 방법 : 응용 프로그램/vnd.contentful.management.v1 + JSON
Content-type: application/vnd.contentful.management.v1+json
내가 Content-type: application/json
을주는 요청 본문을 구문 분석하는 것을 시도하고있다 잘 작동하지만 Contentful CMS는 위의 내용 유형을 전달하므로이 구문을 분석해야합니다.
내가컨텐츠 형의 몸을 구문 분석하는 방법 : 응용 프로그램/vnd.contentful.management.v1 + JSON
Content-type: application/vnd.contentful.management.v1+json
내가 Content-type: application/json
을주는 요청 본문을 구문 분석하는 것을 시도하고있다 잘 작동하지만 Contentful CMS는 위의 내용 유형을 전달하므로이 구문을 분석해야합니다.
만족스런 Java SDK를 사용하고있는 것으로 보입니까?
해당 헤더가 SDK로 채워지므로 해당 헤더를 구문 분석해야하는 이유가 있습니까?
해결책을 찾았습니다.
본문의 유형이 json 인 경우 기본적으로 헤더의 Content-type application/json을 찾습니다.
Content-Type 헤더의 유효성을 검사하지 않으려면 JSON을 사용했고 작동했습니다.
는 BodyParser.Of (BodyParser.TolerantJson.class)
@ 나는 Contentful 내은 webhook를 통합하려합니다. contentful은 헤더에 Content-type : application/vnd.contentful.management.v1 + json이라는 API를 트리거하고 내 Java 애플리케이션은 본문을 구문 분석 할 수 없습니다. application/json이 Content-type이 될 것으로 예상하므로 – Indrajeet
@Indrajeet는 코드에서 application/header 대신 header를 기대할 수 없습니다. –