curl请求IPFS获取API添加字节到下载文件的标题
我在Linux盒上有一个IPFS节点。如果我使用:
ipfs get QmYqGwoiuw47cLhrtQ5yg1TnS6n2ekcLSZZt35gGestTuo
在命令行,下载了IPFS映像(PNG)。
但是,当我使用curl键入等效端点时:
curl --location --request POST 'http://127.0.0.1:5001/api/v0/get?arg=QmYqGwoiuw47cLhrtQ5yg1TnS6n2ekcLSZZt35gGestTuo' --output QmYqGwoiuw47cLhrtQ5yg1TnS6n2ekcLSZZt35gGestTuo
下载的文件是相同的,除了它在文件开始时具有一些字节。
这些出现在文件顶部的``PNG标识符''之前。 (似乎是CID,然后是一些nullstrings,然后一些数字)
在我的帖子请求中我做错了什么可以正确下载文件?由于当前使用卷曲下载的文件是无法使用的。
I have an IPFS node on an linux box. If i use:
ipfs get QmYqGwoiuw47cLhrtQ5yg1TnS6n2ekcLSZZt35gGestTuo
at command line the ipfs image (a png) is downloaded and usable.
However when i hit the equivalent endpoint using CURL:
curl --location --request POST 'http://127.0.0.1:5001/api/v0/get?arg=QmYqGwoiuw47cLhrtQ5yg1TnS6n2ekcLSZZt35gGestTuo' --output QmYqGwoiuw47cLhrtQ5yg1TnS6n2ekcLSZZt35gGestTuo
The file downloaded is identical except it has some bytes at the start of the file.
These appear before the �PNG identifier at the top of the file. (Appears to be the CID followed by some nullstrings then some numbers)
Is there anything i'm doing wrong in my post request to download the file correctly? As currently the files downloaded using CURL are unusable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
<
您可能想要的是 cat :
示例:
输出标题:
get is used to get IPFS objects:
What you likely want is cat:
Example:
Header of output: