最近在做性能测试,在开发web脚本的过程中遇到错误:Action.c(15): Error -26631: HTTP Status-Code=400 (Bad Request) for http://xxxxxx/onlinefront/s.do?tl=51&bk=null&optionId=244&p=110

问了很多人没有人知道问题的原因,最后只能自己潜心研究,首先从http status-code400的错误开始分析,这个错误是说请求无法被处理,因为它含有缺失或无效的信息,根据错误信息的描述应该是发送HTTP请求中语法格式不正确导致不被服务器接受,这很可能就是通过LoadRunner 发送HTTP请求是一个不完整。那么首先要确认的就是比较发出的请求和录制的时候请求看是否丢失了http信息来判断错误的原因。

首先选上runtimesettings中extended log的三个选项后运行此脚本,用录制发送相类似请求的日志和选择exection log的http send请求日志进行对比。拷贝这些请求数据包到一个记事本中然后进行比较。在Recording Log(单协议)或Generation Log(多协议)中查找是否存在头数据包,我们发现在执行日志中头域失踪了。

这样解决问题的方法就是用web_add_header("xxxxx","yyyy")添加一个http头,在错误的请求前添加此函数然后回放。

如果你发现所有的HTTP send请求都缺少头数据包,在脚本中的开头添加web_add_auto_header(”XXXXX“,”yyyy“);随着web_add_auto_header的添加,你不需要为每个HTTP send请求都添加web_add_header了。

还有一个解决问题的方法是在Tools -> Recording Options -> Advanced tab中设置,点“headers”按钮,在列表中选择“Record Headers in the List”,然后选择“XXXXX”,因此它可确保在录制过程中录制自己。

Error -26631: HTTP Status-Code=400 (Bad Request) for的更多相关文章

  1. HttpWebRequest.GetResponse() raises exception when http status code 400 (bad request) is returned

    参考: .Net HttpWebRequest.GetResponse() raises exception when http status code 400 (bad request) is re ...

  2. 解决 android studio 出现:"AndroidStudio:Could not GET 'https://dl.google.com Received status code 400 from server: Bad Request"问题

    一.android studio 编译项目时出现"AndroidStudio:Could not GET 'https://dl.google.com Received status cod ...

  3. Android Studio Gradle build 报错:Received status code 400 from server: Bad Request

    错误提示如下 Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.2/ ...

  4. Failed to load resource: the server responsed with a status of 400 (Bad Request)

    浏览器报错:Failed to load resource: the server responsed with a status of 400 (Bad Request) ajax请求失败,一般情况 ...

  5. 【解决了一个小问题】gin框架中出现如下错误:"[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 400 with 500"

    POST到数据到一条gin框架的接口后,客户端收到400错误,并且返回了业务中返回的"decode json fail". 关键代码是: func report(c *gin.Co ...

  6. HTTP 1.0 Status Code Definitions

    part of Hypertext Transfer Protocol -- HTTP/1.1RFC 2616 Fielding, et al. 10 Status Code Definitions ...

  7. axios请求报Uncaught (in promise) Error: Request failed with status code 404

    使用axios处理请求时,出现的问题解决 当url是远程接口链接时,会报404的错误: Uncaught (in promise) Error: Request failed with status ...

  8. How to fix “HTTP Status Code 505 – HTTP Version Not Supported” error?--转

    http://dotnetstock.com/technical/http-status-code-505-http-version-not-supported/ The reason for the ...

  9. SpringMVC格式转化错误之HTTP Status [400] – [Bad Request]

    SpringMVC中,如果直接为Date类型的属性赋值,服务器有可能会报HTTP Status [400] – [Bad Request] Type Status Report Description ...

随机推荐

  1. Windows7系统下OpenCV2.4.4+PCL1.6.0+SSBA3.0+VS2010 IDE32环境下编译和安装以实现Sfm和PCL点云数据可视化

    最近在学习<深入理解OpenCV:实用计算机视觉项目解析>一书的第三章和第四章时,遇到很多编译问题,书中又没有详细的讲解环境配置和搭建过程.经过多天的捉摸.调试.排错终于将两章的程序都调试 ...

  2. WorldWind源码剖析系列:枚举类型

    PluginSDK中的枚举型主要有以下这些: public enum AltitudeMode//高度模式枚举 { ClampedToGround,//强制到地面模式 RelativeToGround ...

  3. JAVA springmvc+spring+mybatis整合

    一.springmvc---controller  spring----service  mybatiss---dao pring(包括springmvc).mybatis.mybatis-sprin ...

  4. SharePoint2016配置工作流开发环境

    1,下载Web PlatForm5.0  地址:https://www.microsoft.com/web/downloads/platform.aspx 2,保证开发环境能连网,安装Web Plat ...

  5. 开源PaaS工具CloudFoundry落地阿里云

    原文:https://yq.aliyun.com/articles/292815?utm_content=m_37457 云计算技术的不断成熟和完善,尤其是IaaS平台的不断发展,使得越来越多的企业和 ...

  6. web窗体的运用

    using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebAp ...

  7. Luogu P1993 小 K 的农场

    其实很早以前就打好了,但一直忘记写了. 也就是差分约束的模板题. 关于差分约束,也就是用来求关于一些不等式互相约束算出最优解. 推荐一个讲的很好的博客:http://www.cppblog.com/m ...

  8. 浅析arm的异常、中断和arm工作模式的联系

    说到异常向量,会让人联想到中断向量.其实,中断是属于异常的子集的,也就是说中断其实是异常其中的一种. 回到异常向量,他其实是一张表格,每个格子里存放的是一个地址,或者是一个跳转命令,不管是哪个,其目的 ...

  9. STM32---定时器的ETR功能

    定时器的ETR功能 在使用定时器的时候,在引脚复用功能中看到了TIM2_CH1_ETR,这个ETR是什么意思呢? 答:TIM2_CH1_ETR表示两个功能选一个,分别是TIM2_CH1和TIM2_ET ...

  10. JS关闭窗口而不提示

    使用js关闭窗口而不提示代码: window.opener = null; window.open( '', '_self' ); window.close();