ipfs-docs icon indicating copy to clipboard operation
ipfs-docs copied to clipboard

/reference/kubo/rpc/ shows invalid Response format

Open FatNerdPeng opened this issue 3 years ago • 1 comments

Hello Team,I created IPFS node locally,and then I want to look webui on the browser so I referenced the website:

I clicked the first raw and then jumped this website:

so I requested the same PRC API by axios:

and then responsed garbled code,I thought the response data were right because I can see "README.txt" in the garbled code,but I don't konw what's wrong with it.Is my character wrong?Or request headers' content-type wrong? Thanks

FatNerdPeng avatar Jul 22 '22 03:07 FatNerdPeng

You are requesting raw block via /api/v0/block/get, the bytes you see is in dag-pb format. I agree the documentation is confusing, that is a bug in our doc generator.

I am transferring this issue to https://github.com/ipfs/ipfs-docs.

Action item here is to improve https://github.com/ipfs/ipfs-docs/tree/main/tools/http-api-docs to show correct Response format (application/octet-stream)

TODO: Generic fix

other commands' responses have similar issues (example: https://github.com/ipfs/ipfs-docs/issues/1271), we should augment https://github.com/ipfs/go-ipfs-cmds so the docs generator has all the information to produce useful response docs

lidel avatar Jul 22 '22 22:07 lidel