Hi qing
I am usgin groovy to write nGrinder script.
My APIS accept JSON payload as request body and the available options for PUT call, as mentioned in official doument, are :
1. PUT(java.lang.String uri)
2. PUT(java.lang.String uri, byte[] data)
3. PUT(java.lang.String uri, byte[] data, NVPair[] headers)
4. PUT(java.lang.String uri, java.io.InputStream inputStream)
5. PUT(java.lang.String uri, java.io.InputStream inputStream, NVPair[] headers)
Resource:
http://grinder.sourceforge.net/g3/script-javadoc/net/grinder/plugin/http/HTTPRequest.html
As you can see that, there is no method accepting either JSONObject or String as a request body.Only
ByteArray and InputStreams are the valid ones.
Best Regards
Rachit
So how to make a PUT call for an API with JSON as a request body ?