How to send post request with cookies with ngrinder groovy mode

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to send post request with cookies with ngrinder groovy mode

Jamous
Hi,
I want to fire a round of performance test against once REST service. This service can be called only with specific header with user cookies. But I don't know how to do it. Could you help me?
Reply | Threaded
Open this post in threaded view
|

Re: How to send post request with cookies with ngrinder groovy mode

junoyoon
Administrator
Sorry for late response. Actually what you want is well supported by nGrinder.
You can set the headers and send the content in the body by passing them into the third parameter of POST method.

http://grinder.sourceforge.net/g3/script-javadoc/net/grinder/plugin/http/HTTPRequest.html#POST(java.lang.String, byte[], HTTPClient.NVPair[])

And.. the cookie will be automatically handled if the cookie is issued from the controller and you made the subsequent call using same HTTPRequest.

Do you need to specify the cookie which is not issued from server?
Reply | Threaded
Open this post in threaded view
|

Re: How to send post request with cookies with ngrinder groovy mode

Kenny
This post was updated on .
In reply to this post by Jamous
You can refer to the following blog post: How to Send Request with Cookie in nGrinder