You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the body of a post request is not a valid JSON string, I encounter an exception. However, the HTTP interface schema says Request can contain any string.
The exception:
"PluginWrapper: invocation exception encountered.\nexception: \"Error parsing JSON: `expected value at line 1 column 1`\""`>
The invocation that produces the exception:
@Test
funpost() {
val result:InvokeResult<Types.Response?> = client.invoke(
uri = uri,
method ="post",
args =Types.ArgsPost(
url ="https://httpbin.org/post",
request =Types.Request(
body ="Hello World!",
responseType =Types.ResponseType.TEXT
)
)
)
assertNull(result.exceptionOrNull())
assertEquals(200, result.getOrThrow()?.status)
}
krisbitney
changed the title
Bug: Http plugin fails when trying to parse empty JSON
Bug: Http plugin fails when request body contains a string that is not valid JSON
Aug 7, 2023
hey @krisbitney would it make sense to say that this might be a problem for all implementations of the http plugin rather than only the rust impl?
I don't know but possibly. Per the discord conversation, it might make sense for us to change the http request body type to Bytes, or to assume the body String can sometimes be a base64 string.
When the body of a
post
request is not a valid JSON string, I encounter an exception. However, the HTTP interface schema saysRequest
can contain any string.The exception:
The invocation that produces the exception:
Additional context:
https://discord.com/channels/796821176743362611/1010304976406454323/1138196489143857277
The text was updated successfully, but these errors were encountered: