Monday, 7 November 2016

Dynamic Value in Response Header and Need to corelate

Go to Recording Options / HTTP properties / Advanced / Headers and add 'x-csrf-token' or select 'Record header not in list'.
Then record or regenerate the script.

Note: the header name (in web_add_header) is without the colon (:) or space. The right boundary in web_reg_save_param should be \r\n not =


web_add_header("x-csrf-token","{XCsrfToken}"");


The header looks like as follows in server response,

 x-csrf-token: 0FTcidqErDFSk1hTsw0rIw==

I have tried to correlate the function as follows on a proper request,

web_reg_save_param("XCsrfToken","LB=x-csrf-token:  ","RB=\r\n","Search=Headers",LAST);


To remove this error, go to recording options->Preferences-> headers and add C-XSRF Token in headers via clicking this option and regenerate your script again.



1 comment:

  1. Hi,

    How to find where that header statement sholud place?

    ReplyDelete