这是从
CURL documentation
-F、 --形式
(HTTP SMTP IMAP)对于HTTP协议系列,这让curl模拟用户按下提交按钮时填写的表单。
这会导致curl使用内容类型multipart/form data发布数据
根据RFC 2388。
将表单提交给Classic ASP时使用的内容类型为
multipart/form-data
唯一可用的方法是
Request.BinaryRead()
像
Request.Form
是为了
application/x-www-form-urlencoded
数据
下面是一个打电话的简单例子
要求BinaryRead()
为了让你开始:
<%
'Should be less than configured request limit in IIS.
Const maxRequestSizeLimit = ...
Dim dataSize: dataSize = Request.TotalBytes
Dim formData
If dataSize < maxRequestSizeLimit Then
'Read bytes into a SafeArray
formData = Request.BinaryRead(dataSize)
'Once you have a SafeArray its up to you to process it.
...
Else
Response.Status = "413 PAYLOAD TOO LARGE"
Response.End
End If
%>
解析安全数组并不容易
如果你想继续使用
要求类型
可以通过在CURL命令中使用
-d
而不是
-F
从…起
the documentation
;
-d、 --数据
(HTTP)将POST请求中的指定数据发送到HTTP服务器,就像用户填写HTML表单并按下提交按钮时浏览器所做的那样。
这将导致curl使用内容类型application/x-www-form-urlencoded将数据传递给服务器
.与-F,-form相比。
所以CURL命令类似于;
curl -X POST \
http://go.mytest-service.com/ \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d fff=vvvvv \
-d rrrr=ddddd \
-d xx=something
然后,您将检索
xx
参数在经典ASP中的使用;
<%
Dim xx: xx = Request.Form("xx")
%>
有用的链接