Curl 卷曲-如何逃脱<;在参数值中
这是我正在执行的curl命令Curl 卷曲-如何逃脱<;在参数值中,curl,escaping,Curl,Escaping,这是我正在执行的curl命令 curl -F "context=<http://example.com>" \ -F "Content-Type=text/plain" \ -F "source=file" \ -F "content=@members.nt;type=text/plain" \ http://localhost:8080/openrdf-workbench/repositories/XXX/add 我尝试使用\和
curl -F "context=<http://example.com>" \
-F "Content-Type=text/plain" \
-F "source=file" \
-F "content=@members.nt;type=text/plain" \
http://localhost:8080/openrdf-workbench/repositories/XXX/add
我尝试使用\和<和%3C来逃避它
但是运气不好,因为我一试着这么做,另一端就抱怨说,它没有完全实现
这是从浏览器表单发送的内容
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="baseURI"
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="context"
<http://example.com>
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="Content-Type"
text/plain
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="source"
file
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="content"; filename="members.nt"
Content-Type: application/octet-stream
------WebKitFormBoundaryl8CUSIvy5962lwBF--
----WebKitFormBoundaryl8CUSIvy5962lwBF
内容配置:表单数据;name=“baseURI”
------WebKitFormBoundaryl8CUSIvy5962lwBF
内容配置:表单数据;name=“上下文”
------WebKitFormBoundaryl8CUSIvy5962lwBF
内容配置:表单数据;name=“内容类型”
文本/纯文本
------WebKitFormBoundaryl8CUSIvy5962lwBF
内容配置:表单数据;name=“来源”
文件
------WebKitFormBoundaryl8CUSIvy5962lwBF
内容配置:表单数据;name=“content”;filename=“members.nt”
内容类型:应用程序/八位字节流
------WebKitFormBoundaryl8CUSIvy5962lwBF--
有什么建议吗?你可以使用curl的
--form string
,它类似于-F
,但不解释引导@
和谢谢你@jkbkot你救了我一天:-)谢谢,伙计,这帮了我很大的忙
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="baseURI"
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="context"
<http://example.com>
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="Content-Type"
text/plain
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="source"
file
------WebKitFormBoundaryl8CUSIvy5962lwBF
Content-Disposition: form-data; name="content"; filename="members.nt"
Content-Type: application/octet-stream
------WebKitFormBoundaryl8CUSIvy5962lwBF--
--form-string <name=string>
(HTTP) Similar to --form except that the value string for the named parameter is used literally. Leading '@' and '<' characters, and the ';type=' string in the value have
no special meaning. Use this in preference to --form if there's any possibility that the string value may accidentally trigger the '@' or '<' features of --form.