0 评论

0 收藏

分享

请问如何在web 前端中直接调用 api?

使用 api  文档中(https://openapi.huoban.com/doc-661255)的 open-authorization 会报错跨域 Request header field open-authorization is not allowed by Access-Control-Allow-Headers in preflight response

看了下 OPTIONS 请求,合法的 header 有这些:
access-control-allow-headers: Content-Type, Authorization, X-Huoban-Return-Fields, X-Huoban-H5-Info, X-Huoban-Ticket, X-Huoban-Request-From, X-Huoban-Application-Resource, X-Third-Domain, X-Huoban-Monitor-Debug, X-Huoban-Monitor-Tag, X-Huoban-Monitor-Secret, X-Huoban-Security-Token, X-Huoban-Sensors, X-Huoban-Request-Id, X-Huoban-Client-Id, X-Huoban-Token-Company, X-Huoban-Language


没有在 open api 文档中看到这些 header 的解释,请问如何在 web 前端中直接调用 open api?
access-control-allow-headers:
Content-Type, Authorization, X-Huoban-Return-Fields, X-Huoban-H5-Info, X-Huoban-Ticket, X-Huoban-Request-From, X-Huoban-Application-Resource, X-Third-Domain, X-Huoban-Monitor-Debug, X-Huoban-Monitor-Tag, X-Huoban-Monitor-Secret, X-Huoban-Security-Token, X-Huoban-Sensors, X-Huoban-Request-Id, X-Huoban-Client-Id, X-Huoban-Token-Company, X-Huoban-Language

access-control-allow-headers:
Content-Type, Authorization, X-Huoban-Return-Fields, X-Huoban-H5-Info, X-Huoban-Ticket, X-Huoban-Request-From, X-Huoban-Application-Resource, X-Third-Domain, X-Huoban-Monitor-Debug, X-Huoban-Monitor-Tag, X-Huoban-Monitor-Secret, X-Huoban-Security-Token, X-Huoban-Sensors, X-Huoban-Request-Id, X-Huoban-Client-Id, X-Huoban-Token-Company, X-Huoban-Language


回复

举报 使用道具

全部回复
暂无回帖,快来参与回复吧
gs(9147752)
注册会员
主题 1
回复 0
粉丝 0
|网站地图
快速回复 返回顶部 返回列表