当我在收到访问令牌后在 golang 程序中给出这段代码时:f, err := ioutil.ReadFile("C:\\Users\\vembu\\Desktop\\hi.txt")ioutil.WriteFile("hi.txt", f, 0x777)r, _ := http.NewRequest("POST", urlStr, bytes.NewBuffer(f)) r.Header.Add("Authorization", "Bearer "+accessobj.Access_token)r.Header.Add("attributes", "{\"name\":\"hi.txt\",\"parent\":{\"id\":\"3098791209\"}}")r.Header.Add("file", "hi.txt")我收到此错误:I face &{405 Method Not Allowed 405 HTTP/1.1 1 1 map[Allow:[GET, OPTIONS, HEAD] Content-Type:[text/html;charset=UTF-8] Content-Length:[0] Date:[Thu, 12 Mar 2015 13:07:32 GMT] Age:[0] Connection:[keep-alive] Server:[ATS]] 0xc08200b8c0 0 [] false map[] 0xc08201f2b0 0xc082060980}任何人都可以帮我解决添加属性和文件名上传到box帐户的方法吗?
1 回答
- 1 回答
- 0 关注
- 182 浏览
添加回答
举报
0/150
提交
取消