Groovy HttpBuilder - Get Body Of Failed Response

后端 未结 3 870
后悔当初
后悔当初 2021-02-05 16:52

I am trying to use the Groovy HTTPBuilder to write an integration test that will verify a correct error message is returned in the body along with an HTTP 409 status message. Ho

3条回答
  •  你的背包
    2021-02-05 17:17

    Does it work if you use:

    response.failure = { resp, reader ->
        failstatus = resp.statusLine
        failresp   = reader.text
    }
    

提交回复
热议问题