JMeter -/在后续 HTTP 请求中发布时替换为 %2F [英] JMeter - / replaced with %2F when posting in subsequent HTTP request

查看:24
本文介绍了JMeter -/在后续 HTTP 请求中发布时替换为 %2F的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用:ASP.NET

在 Regex 后处理器中捕获的值:

Value captured in Regex post processor:

__VIEWSTATE:  /wEPDwULLTEwMjgyMTI3ODAPZBYCAgEPZBYCAgEPDxYCHgRUZXh0ZWRkZAX+cy5B/46umWN01upyRg2q//kD

在 HTTP 请求中发布的值:

Value posted in HTTP request:

__VIEWSTATE:  %2FwEPDwULLTEwMjgyMTI3ODAPZBYCAgEPZBYCAgEPDxYCHgRUZXh0ZWRkZAX+cy5B%2F46umWN01upyRg2q%2F%2FkD

问题:发帖时/被替换为%2F.

Problem: / is replaced with %2F when posting.

响应:此页面的状态信息无效,可能已损坏.

Response: The state information is invalid for this page and might be corrupted.

感谢您对解决此问题的任何帮助...

Appreciate any help in sorting out this issue...

推荐答案

有几个选项可以继续:

  1. 取消选中编码?"HTTP 请求采样器 的 __VIEWSTATE 参数框 - 将按原样发送.
  2. 使用__urldecode() JMeter 函数
  3. 使用 Beanshell Pre Processor 和以下内容代码:

  1. Uncheck "Encode?" box for __VIEWSTATE parameter of HTTP Request Sampler - it will be sent as is.
  2. Use __urldecode() JMeter Function
  3. Use Beanshell Pre Processor with the following code:

import java.net.URLDecoder;
vars.put("VIEWSTATE", URLDecoder.decode(vars.get("VIEWSTATE"), "UTF-8"));

上面的代码假设保存视图状态的变量称为 VIEWSTATE

The code above assumes that variable holding your viewstate is called VIEWSTATE

这篇关于JMeter -/在后续 HTTP 请求中发布时替换为 %2F的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆