0
나는 grabu에서 httpbuilder를 사용하여 전화를 걸고 있습니다. 내가 몸 값을 하드 코딩하지만이 같은 사용하여 변수를 통과 할 때, 그것은 나에게주는 유지하는 경우 모든 작동합니다 -Grails HTTPBuilder가 본문의 변수로 작동하지 않습니다.
Unprocessable Entity. Stacktrace follows:
Message: Unprocessable Entity
Line | Method
->> 636 | defaultFailureHandler in groovyx.net.http.HTTPBuilder
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 492 | doRequest in ''
| 427 | doRequest . . . . . . in ''
| 376 | request in ''
코드는 다음과 같다 - 나는 변수를 교체 할 경우
def input = "s3://in_folder/inputFile.mp3"
def outFile = "outFile.m3u8"
def http = new HTTPBuilder("https://app.gridserver.com")
http.request(groovyx.net.http.Method.POST, groovyx.net.http.ContentType.JSON) { req ->
uri.path = 'api/v2'
headers.Accept = 'application/json'
headers.'Key' = "ssdflkjdf8338fdjsd"
body = ["input": input,
"output":[ "filename": outFile,
"format": "mp3",
] ]
response.success = { resp, reader ->
println "Got response: ${resp}"
}
}
}
"input and outFile"여기 실제 값으로 잘 작동합니다.
' "$ input"'과' "$ outFile"'을 사용하려고한다면? – dmahapatro
"처리 할 수없는 엔터티"는 서버에서 반환 한 HTTP 422 오류 코드입니다. [와이어 로깅 켜기] (http://groovy.codehaus.org/modules/http-builder/doc/#Logging_and_Debugging)와 두 경우 모두에서 전송되는 내용을 정확히 확인할 수 있습니까? –
@dmahapatro 나는 그것을 또한 시도했다. "$ {input}"을 넣지 만 여전히 같은 오류가 발생합니다. – saurabh