CURL upload file box.com问题
我正在尝试使用box.com进入我的帐户 当我使用下面的命令时,它抛出下面的错误 我不知道这里的语法问题是什么 有人能帮我吗CURL upload file box.com问题,curl,box,Curl,Box,我正在尝试使用box.com进入我的帐户 当我使用下面的命令时,它抛出下面的错误 我不知道这里的语法问题是什么 有人能帮我吗 curl -g https://upload.box.com/api/2.0/files/content -H "Authorization: Bearer Fn3A7dadfxSscUrfQbY7aSrj7ihR899TBgZ" -X POST -F attributes='{"name":"pappi.jpg", "parent":{"id":"0"}}' -F fi
curl -g https://upload.box.com/api/2.0/files/content -H "Authorization: Bearer Fn3A7dadfxSscUrfQbY7aSrj7ihR899TBgZ" -X POST -F attributes='{"name":"pappi.jpg", "parent":{"id":"0"}}' -F file=@pappi.jpg
{“类型”:“错误”,“状态”:400,“代码”:“错误请求”,“上下文信息”:{“错误”:[{“原因”:“无效参数”,“名称”:“实体体”,“消息”:“无效”
值“”{name:pappi.jpg')。实体体应该是正确嵌套的
资源属性名称/值
对“}]},“帮助url”:http://developers.box.com/docs/#errors“,”消息“:”不好
请求,请求id:“93232892358c3571c303f0”}curl:(6)无法
解析主机:父:{id
我只是用一个dev令牌尝试了一下,它似乎起了作用
curl https://upload.box.com/api/2.0/files/content
-H "Authorization: Bearer <devtoken>" -X POST
-F attributes='{"name":"ken.jpg", "parent":{"id":"0"}}'
-F file=@ken.jpg
{"total_count":1,"entries":[{"type":"file","id":"149964282905","file_version": {"type":"file_version","id":"159621506329","sha1":"078 8d369db76258c45b08be771ff4a55a43d9661"},"sequence_id":"0","etag":"0","sha1":"0788d369db76258c45b08be771ff4a55a43d9661","name":"ken.jpg","description":"","size":5079,"path_collection":{"total_count":1,"entries":[{"type":"folder","id":"0","sequence_id":null,"etag":null,"name":"All Files"}]},"created_at":"2017-03-21T14:48:46-07:00","modified_at":"2017-03-21T14:48:46-07:00","trashed_at":null,"purged_at":null,"content_created_at":"2017-03-21T14:48:46-07:00","content_modified_at":"2017-03-21T14:48:46-07:00","created_by":{"type":"user","id":"270956269","name":"Ken.Domen.Test","login":"ken.domen.test@nike.com"},"modified_by":{"type":"user","id":"270956269","name":"Ken.Domen.Test","login":"ken.domen.test@nike.com"},"owned_by":{"type":"user","id":"270956269","name":"Ken.Domen.Test","login":"ken.domen.test@nike.com"},"shared_link":null,"parent":{"type":"folder","id":"0","sequence_id":null,"etag":null,"name":"All Files"},"item_status":"active"}]}APYRDV30BA5D24:curl kdomen$
curlhttps://upload.box.com/api/2.0/files/content
-H“授权:持票人”-X邮政
-F attributes='{“name”:“ken.jpg”,“parent”:{“id”:“0”}'
-F file=@ken.jpg
{“总计数”:1,“条目”:[{“类型”:“文件”,“id”:“149964282905”,“文件版本”:“{“类型”:“文件版本”,“id”:“159621506329”,“sha1”:“078 8D369DB76258C45B08BE771F4A55A43D9661”},“序列号”:“0”,“etag”:“0”,“sha1”:“0788D369DB76258C45B08BE771F4B771F45A43D9661”,“名称”:“ken.jpg”,“说明”:“大小”:5079,“路径集合”:“总计数”:“条目”:[{“type”:“folder”,“id”:“0”,“sequence_id”:null,“etag”:null,“name”:“All Files”}],“created_at”:“2017-03-21T14:48:46-07:00”,“modified_at”:“2017-03-21T14:48:46-07:00”,“trashed__at”:null,“pucleared___at”:null,“content_created__at”:“2017-03-21T14:48:46-07:00”,“content_modified_at”:“2017-03-21T14:48:46-07:00”,“用户创建的类型”;“id”:“6269”::“Ken.Domen.Test”,“登录”:“Ken.Domen”。test@nike.com“}”,修改者:{”type:“user”,“id:“270956269”,“name:“Ken.Domen.Test”,“login:“Ken.Domen”。test@nike.com“}”,所有者:{“类型”:“用户”,“id”:“270956269”,“名称”:“Ken.Domen.Test”,“登录”:“Ken.Domen”。test@nike.com},“共享链接”:null,“父项”:{“类型”:“文件夹”,“id”:“0”,“序列id”:null,“etag”:null,“名称”:“所有文件”},“项目状态”:“活动”}]}APYRDV30BA5D24:curl kdomen$