json - Excel 2010 VBA - 尝试使用 API JSON 从站点检索数据
问题描述
预先感谢您的任何帮助!!第一次使用 api 调用。尝试从我位于 artofbooks.com 的库存文件中检索信息的单元格中输入 ISBN 他们的 API 调用文档不是很好。这是我的代码,我收到“错误令牌”错误。
sub test
creds = EncodeBase64("{ AOB_AUTH_USER : cottagebooks, AOB_AUTH_PW : xxxxxx }")
isbn = Cells(5, 3).Value
Set objHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
URL = "https://www.theartofbooks.com/api/2.0/item=2010101257"
objHttp.Open "GET", URL, False
objHttp.SetRequestHeader "Content-Type", "multipart/form-data"
objHttp.SetRequestHeader "Accept", "application/xml"
objHttp.SetRequestHeader "Authorization:", "Bearer " & creds
objHttp.Send
strResponseStatus = objHttp.Status
strresponsetext = objHttp.ResponseText
strresponsetext = CStr(strresponsetext)
MsgBox strresponsetext
end sub
解决方案
推荐阅读
- javascript - 在同一窗口中打开 Google 协作平台 HTML 链接
- tableau-api - Tableau LOD 问题(如何使用忽略一个过滤器但保留其他过滤器的总数百分比?)
- google-chrome-devtools - 使用 Chrome 开发工具代码折叠快捷方式
- javascript - 如何将特定的 api 响应保存到变量
- javascript - 如何以串行方式列出一长串 http 调用?
- php - 连接被拒绝 SQL: select * from information_schema.tables where table_schema = firstdb and table_name = migrations and table_type = 'BASE TABLE
- javascript - ToastUI 日历依赖要求
- c - 用 typedef 声明指向结构的指针有什么用?
- bootstrap-4 - Bootstrap Datatable中搜索栏和表格内容之间的差距?
- java - 重定向多个 Angular 9 应用程序