post接口_ajax上传
Action()
{ web_reg_save_param("find_msg",
"LB=message\":\"",
"RB=\"",
"Ord=1",
LAST); //特殊情况需要加
web_add_header("Content-Type","multipart/form-data"); lr_start_transaction("ajax_upload"); web_submit_data("Attachments", "Action=http://localhost:8080/pinter/file/api/upload2", "Method=POST", "EncType=multipart/form-data", "TargetFrame=", "RecContentType=text/html", "Snapshot=t5.inf", "Mode=HTML", ITEMDATA, "Name=file", "Value=C:\\a.txt", "File=yes",
ENDITEM, LAST ); //utf8->转化为本地解码
lr_convert_string_encoding(lr_eval_string("{find_msg}"), LR_ENC_UTF8, LR_ENC_SYSTEM_LOCALE, "msg"); if(strcmp(lr_eval_string("{msg}"),"上传成功") == ){
lr_end_transaction("ajax_upload", LR_PASS); }else{
lr_end_transaction("ajax_upload", LR_FAIL); } return ;
}
运行日志如下:
Virtual User Script started at : -- ::
Starting action vuser_init.
Web Turbo Replay of LoadRunner 11.0. for WINXP; build (Aug ::) [MsgId: MMSG-]
Run Mode: HTML [MsgId: MMSG-]
Run-Time Settings file: "C:\test_huzhenyu\Script\upload_ajax\\default.cfg" [MsgId: MMSG-]
Ending action vuser_init.
Running Vuser...
Starting iteration .
Starting action Action.
Action.c(): Registering web_reg_save_param was successful [MsgId: MMSG-]
Action.c(): Warning -: The header being added may cause unpredictable results when applied to all ensuing URLs. It is added anyway [MsgId: MWAR-]
Action.c(): web_add_header("Content-Type") highest severity level was "warning" [MsgId: MMSG-]
Action.c(): Notify: Transaction "ajax_upload" started.
Action.c(): t=553ms: -byte response headers for "http://localhost:8080/pinter/file/api/upload2" (RelFrameId=, Internal ID=)
Action.c(): HTTP/1.1 \r\n
Action.c(): Content-Type: application/json;charset=UTF-\r\n
Action.c(): Transfer-Encoding: chunked\r\n
Action.c(): Date: Fri, Mar :: GMT\r\n
Action.c(): \r\n
Action.c(): t=581ms: -byte chunked response overhead for "http://localhost:8080/pinter/file/api/upload2" (RelFrameId=, Internal ID=)
Action.c(): \r\n
Action.c(): t=590ms: -byte chunked response overhead for "http://localhost:8080/pinter/file/api/upload2" (RelFrameId=, Internal ID=)
Action.c(): \r\n
Action.c(): \r\n
Action.c(): \r\n
Action.c(): t=621ms: -byte chunked response body for "http://localhost:8080/pinter/file/api/upload2" (RelFrameId=, Internal ID=)
Action.c(): {"code":"","message":"涓婁紶鎴愬姛","data":null}
Action.c(): Notify: Saving Parameter "find_msg = 涓婁紶鎴愬姛".
Action.c(): HTML parsing not performed for Content-Type "application/json" ("ParseHtmlContentType" Run-Time Setting is "TEXT"). URL="http://localhost:8080/pinter/file/api/upload2" [MsgId: MMSG-]
Action.c(): web_submit_data("Attachments") was successful, body bytes, header bytes, chunking overhead bytes [MsgId: MMSG-]
Action.c(): Notify: Parameter Substitution: parameter "find_msg" = "涓婁紶鎴愬姛"
Action.c(): Notify: Saving Parameter "msg = 上传成功\x00".
Action.c(): Notify: Parameter Substitution: parameter "msg" = "上传成功\x00"
Action.c(): Notify: Transaction "ajax_upload" ended with "Pass" status (Duration: 0.5931 Wasted Time: 0.4267).
Ending action Action.
Ending iteration .
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
log
post接口_ajax上传的更多相关文章
- java微信接口之四—上传素材
一.微信上传素材接口简介 1.请求:该请求是使用post提交地址为: https://api.weixin.qq.com/cgi-bin/media/uploadnews?access_token=A ...
- java微信接口之三—上传多媒体文件
一.微信上传多媒体接口简介 1.请求:该请求是使用post提交from来实现的,我们可以在网页上进行表单提交来实现.地址为: http://file.api.weixin.qq.com/cgi-bin ...
- Python+requests库 POST接口图片上传
捕获到POST接口的请求参数,如下: 包括data.file两个部分,上传代码如下: 比较简单,直接发送files参数即可 heads中 content-type 折腾了1个小时,呵呵
- 利用 python requests完成接口文件上传
最近在准备一个公开课,主题就是利用不同的语言和不同的工具去实现文件的上传和下载. 在利用Jmeter去实现功能的时候,以及利用loadrunner去写脚本的时候,都很顺利,没有任何问题,当我尝试用Py ...
- Java文件上传:Restful接口接收上传文件,缓存在本地
接口代码 import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; i ...
- el-upload控件一次接口请求上传多个文件
el-upload组件默认情况下上传多少个文件就会请求多少次上传接口,如何一次上传多个文件而不必多次请求上传接口呢?直接看代码 html <el-upload :action="act ...
- C#post调用接口并上传文件
/// <summary> /// C#调用接口上传json数据,并且带文件上传 /// </summary> /// <param name="url&quo ...
- 微信开发平台中有个接口是上传多媒体文件,我用的是java 开发的,我怎么样才能在后台实现呢?
/** * 文件上传到微信服务器 * @param fileType 文件类型 * @param filePath 文件路径 * @return JSONObj ...
- delphi请求http接口并上传附件
实现附件的上传:需要使用TIdMultiPartFormDataStream控件, uses IdMultipartFormData; 例子: procedure TClientForm.Button ...
随机推荐
- SignalR 教程二 服务端广播
转帖官方教程:Tutorial: Server Broadcast with SignalR 2 http://www.asp.net/signalr/overview/getting-started ...
- 禁用Linux透明大页
Oracle 安装时官方建议关闭Linux的透明大页,防止内存延迟分配导致的性能问题 https://docs.oracle.com/cd/E11882_01/install.112/e47689/p ...
- mysql 使用order by
1.mysql 使用order by field() 自定义排序 order by field(value,str1,str2,str3,str4......strn) 例如:select * fro ...
- 09 OCP知识点讲解 之 LRU链与脏LRU链
OCP知识点讲解 之 LRU链与脏LRU链 分类: Oracle 2012-06-30 10:49:26 一.LRU链: 任何缓存的大小都是有限制的,并且总不如被缓存的数据多.就像Buffer c ...
- 持续集成(CI – Continuous Integration)
持续集成(CI – Continuous Integration) 在传统的软件开发中,整合过程通常在每个人完成工作之后.在项目结束阶段进行.整合过程通常需要数周乃至数月的时间,可能会非常痛苦.持续集 ...
- 为什么有时候binlog文件会很大于max_binlog_size以及max_binlog_cache_size
问题描述 线上一个很有意思的现象,发现binlog文件大小是15G,查看了参数max_binlog_size是1073741824[1G], max_binlog_cache_size是2147483 ...
- 分布式网上商城项目- BeanDefinitionStoreException
BeanDefinitionStoreException: 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanDe ...
- react之styled-components(基础篇)
介绍 它是react的一个库,可以用来美化组件 它的写法依赖于es6,依赖于webpack 安装 -yarn add styled-components 基本使用的一些方法 -as -Adapting ...
- button onclick实现跳转的常用方法
1.onclick="javascript:window.location.href='aa.htm' " 2.onclick="location='URL' " ...
- 1. 了解HTML
HTML概念 HTML,超文本标记语言.它由一套标签组成用来描述网页,值得我们注意的是HTML并不是编程语言,它只是一种标记,我们通过HTML定义了网页的结构,然后再利用其他技术装饰这个结构,赋予这个 ...