Hi Vishnu,
Thanks!
Jim
On Tuesday, September 24, 2024 at 11:18:15 PM EDT, Vishnu Nandita Ramisetty
<[email protected]> wrote:
Hi Jim,
Please try by using codebase
// Get the response as a string
String response = prev.getResponseDataAsString();
// Remove leading and trailing double quotes and any trailing space
response = response.replaceAll(/^"|"[ ]*$/, '');
// Put the cleaned response back into a variable
vars.put("response", response);
Thanks & regards
Lakshmi Prasad
On Wed, Sep 25, 2024, 2:52 AM ohaya <[email protected]> wrote:
> Hi,
> I am working on a test plan where I send a POST request to authenticate,
> and I get a token in the response.
> Then, I need to send the token in GET request to get authorized.
> The problem I am having is that the the response I am getting to the POST
> has the token surrounded by double-quotes (a double-quote in the front, and
> a double-quote, or possibly a double-quote followed by a blank/space) and I
> think that the double-quotes are causing the error.
> I am extracting the token in a JSR233 Postprocessor with the following
> script:
> vars.put("response", prev.getResponseDataAsString());Can I remove the
> leading double-quote and the trailing double-quote (or possibly trailing
> double-quote+space in the same Postprocessor, and if so how can I do that?
> Thanks,Jim
>