使用带有编码 URL 的 CURL 删除 [英] DELETE using CURL with encoded URL
本文介绍了使用带有编码 URL 的 CURL 删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 CURL 发出请求,如下所示:
I’m trying to make a request using CURL like this:
curl -X DELETE "https://myhost/context/path/users/OXYugGKg207g5uN/07V"
其中 OXYugGKg207g5uN/07V
是一个哈希值,所以我想我需要在执行此请求之前进行编码.
where OXYugGKg207g5uN/07V
is a hash, so I suppose that I need to encode before do this request.
我试过 curl -X DELETE --data-urlenconded "https://myhost/context/path/users/OXYugGKg207g5uN/07V"
一些想法?
推荐答案
如果 OXYugGKg207g5uN/07V
确实是哈希,那么您需要对其进行编码,而不是整个 url.您可以使用在使用 cURL 的环境中可用的编码函数.
If really OXYugGKg207g5uN/07V
is the hash then you need to encode that, not the whole url. You can use an encoding function available inside the environment you use cURL in.
这篇关于使用带有编码 URL 的 CURL 删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文