Languages/Kotlin
[Kotlin] Content is not allowed in prolog.; HTTP header setting error
재조(jazzo)
2021. 6. 8. 10:56
반응형
Tableau api를 활용하여 개발 중, json 형태의 데이터를 보내 응답을 받아야 하는데 아래 오류가 뜨는 경우
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: [{"error":{"summary":"Bad Request","detail":"Deserialization problem: Content is not allowed in prolog.; ","code":"400000"}}]] with root cause
http header에 content-type을 지정해주면 해결되었다.
val header = HttpHeaders()
header.set("content-type", "application/json")
728x90
반응형