CURL模拟表单post提交及相关常用参数的使用(包括提交表单同时上传文件)
- curl -d "key=value&key=value" "url"
- curl --data "key=value&key=value" "url"
- <form action="doLogin" method="post">
- <input type="text" name="username" value="admin"/>
- <input type="password" name="password" value="admin"/>
- <button type="submit" value="submit" />
- </form>
- curl -d "username=admin&password=admin" "www.xxxx.com/doLogin"
- curl -L -d "username=admin&password=admin" "www.xxx.com/doLogin"
- curl -c cookie.txt -d "username=admin&password=admin" "www.xxx.com/doLogin"
- curl -L -b cookie.txt -d "key=value" "url"
- <form action="upload" method="post" enctype="multipart/form-data">
- <input type="file" name="myfile" />
- <button type="submit" value="submit" />
- </form>
- curl -F "myfile=@hellocurl.zip" "www.xxx.com/upload"
- curl -F "myfile1=@hellocurl1.zip" -F "myfile2=@hellocurl2.zip" "www.xxx.com/upload"
- <form action="upload" method="post" enctype="multipart/form-data">
- <span style="color:#990000;"><input type="text" name="filename" value="hellocurl"/></span>
- <input type="file" name="myfile" />
- <button type="submit" value="submit" />
- </form>
- curl -F "filename=hellocurl" -F "myfile2=@hellocurl2.zip" "www.xxx.com/upload"
- curl -F "key=@value" "www.xxx.com/upload?key1=value1&key2=value2"
- curl -F "myfile2=@hellocurl2.zip" "www.xxx.com/upload?filename=hellocurl"
-o:保存响应结果到指定路径的文件中,如: curl -o tmp.txt http://www.csdn.net #保存响应到tmp.txt
CURL模拟表单post提交及相关常用参数的使用(包括提交表单同时上传文件)的更多相关文章
- 关于php上传文件过大的表单回填
也许标题有点绕口,有点无法让人理解.请原谅博主,语文学的不好,都赖体育老师. 问题场景重现:在某次迭代中,接到这样一个需求:当新建或编辑一个Bug(包含附件以及其他字段)上传附件过大时,退回到编辑页面 ...
- c# 模拟表单提交,post form 上传文件、大数据内容
表单提交协议规定:要先将 HTTP 要求的 Content-Type 设为 multipart/form-data,而且要设定一个 boundary 参数,这个参数是由应用程序自行产生,它会用来识别每 ...
- java模拟表单上传文件,java通过模拟post方式提交表单实现图片上传功能实例
java模拟表单上传文件,java通过模拟post方式提交表单实现图片上传功能实例HttpClient 测试类,提供get post方法实例 package com.zdz.httpclient; i ...
- java 模拟表单方式提交上传文件
/** * 模拟form表单的形式 ,上传文件 以输出流的形式把文件写入到url中,然后用输入流来获取url的响应 * * @param url 请求地址 form表单url地址 * @param f ...
- c# 模拟表单提交,post form 上传文件、数据内容
转自:https://www.cnblogs.com/DoNetCShap/p/10696277.html 表单提交协议规定:要先将 HTTP 要求的 Content-Type 设为 multipar ...
- 使用CURL模拟表单上传文件
//以下代码适合PHP7.x PHP5.6$file = new CURLFile('./127.zip','application/octet-stream');$file->setMimeT ...
- Linux 基础命令-CURL 表单上传文件
CURL -F, --form <name=content> (HTTP) This lets curl emulate a filled-in form in which a user ...
- 4 django系列之HTML通过form标签来同时提交表单内容与上传文件
preface 我们知道提交表单有2种方式,一种直接通过submit页面刷新方法来提交,另一种通过ajax异步局部刷新的方法提交,上回我们说了通过ajax来提交文件到后台,现在说说通过submit来提 ...
- tp中附件上传文件,表单提交
public function tianjia(){ $goods=D('Goods'); if(!empty($_POST)){ if($_FILES['f_goods_image']['error ...
随机推荐
- cmd乱码问题
1.进入 cmd 窗口 2.字符编码切换回中文:chcp 936 MS-DOS为以下国家和语言提供字符集: 代码页描述 1258 越南语 1257 波罗的语 1256 阿拉伯语 1255 希 ...
- Tomcat安装、配置和部署
首先从Apache的官方网站(http://tomcat.apache.org/)下载Tomcat.有安装版和解压版两种,本文档介绍绿色版安装方法. 一.Tomcat安装(绿色版安装) 1.将下载的T ...
- 纯css背景图自适应
只需要这样设置即可,只要你的图片足够大的话可以无限缩小,当不在缩小的时候则跟你的实际图片大小有关系
- 在微信小程序中调用本地接口
1.点击详情,并勾选项目设置中最后一行. 2.用小程序请求本地的后台服务接口 wx.request({ url: 'http://localhost:8090/DemoProject/myTest.d ...
- 弹框alertView
// 创建一个弹框UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@“标题” message:@“显示的具体内容” delegate:s ...
- rviz2
VINS-Mono ####Panels: 面板: - Class: rviz/Displays 显示1 Help Height: Name: Displays Property Tree Widge ...
- javascript 重构alert()
javascript问题,关于重构window.alert()后,然后调用window原本的window.alert()的方法 大神们,问个问题,如果在script标签的第一行散写,重构了window ...
- PAT 1049 数列的片段和(20)(代码+思路分析)
1049 数列的片段和(20)(20 分) 给定一个正数数列,我们可以从中截取任意的连续的几个数,称为片段.例如,给定数列{0.1, 0.2, 0.3, 0.4},我们有(0.1) (0.1, 0.2 ...
- XiaoKL学Python(D)argparse
该文以Python 2为基础. 1. argparse简介 argparse使得编写用户友好的命令行接口更简单. argparse知道如何解析sys.argv. argparse 模块自动生成 “帮助 ...
- 应用内直接跳转到Appstore
iOS开发中,应用内直接跳转到Appstore .进入appstore中指定的应用 NSString *str = [NSString stringWithFormat: @"itms:// ...