如何发布网址在卷曲请求数据 [英] How to Post Url in data of a curl request

查看:177
本文介绍了如何发布网址在卷曲请求数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试后使用curl两个参数。
结果
路径和文件名

I am trying to post two parameters using curl.
path and fileName

curl --request POST 'http://localhost/Service' --data "path='/xyz/pqr/test/'&fileName='1.doc'"

我知道什么是错在于此。结果
我有使用类似URLEn code。我试过很多事情仍然没有运气。
请举一个例子,我怎样才能文章的网址在袅袅的请求数据。

I know something is wrong in this.
I have to use something like URLEncode. I tried many things still no luck.
Please give an example how can I post the url in data of curl request.

推荐答案

也许你不必包括单引号:

Perhaps you don't have to include the single quotes:

curl --request POST 'http://localhost/Service' --data "path=/xyz/pqr/test/&fileName=1.doc"

更新:阅读卷曲手册,你实际上可以这两个领域有两个分开 - 性能参数:

Update: Reading curl's manual, you could actually separate both fields with two --data:

curl --request POST 'http://localhost/Service' --data "path=/xyz/pqr/test/" --data "fileName=1.doc"

您也可以尝试--data二进制:

You could also try --data-binary:

curl --request POST 'http://localhost/Service' --data-binary "path=/xyz/pqr/test/" --data-binary "fileName=1.doc"

和--data-urlen code:

And --data-urlencode:

curl --request POST 'http://localhost/Service' --data-urlencode "path=/xyz/pqr/test/" --data-urlencode "fileName=1.doc"

这篇关于如何发布网址在卷曲请求数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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