javascript - Indeed API 访问控制允许来源

标签 javascript angularjs access-control

我想使用 Indeed.com ( https://ads.indeed.com/ ) 的 API。 问题是,他们将响应设置为“同源”-> 意味着我无法在我的平台上使用它。由于谷歌上没有太多可以找到的问题是,是否有人知道如何使用这个API

请求示例:

http://api.indeed.com/ads/apisearch?publisher=xxxxx&q=java&l=austin%2C+tx&sort=&radius=&st=&jt=&start=&limit=&fromage=&filter=&latlong=1&co=us&chnl=&v=2&format=json&callback=results&v=2

响应 header 示例:

 HTTP/1.1 200 OK
Date: Thu, 04 Aug 2016 12:59:01 GMT
Server: Apache
Set-Cookie: CTK=1apaq5d2k5mlkchh; Expires=Tue, 09-Aug-2033 07:47:32 GMT; Path=/
Set-Cookie: ctkgen=1; Expires=Thu, 04-Aug-2016 13:02:01 GMT; Path=/
Set-Cookie: JSESSIONID=47FBC363B7DE7AA7FB455319986F2DC3.jasxA_iad-job4; Path=/; HttpOnly
X-Frame-Options: SAMEORIGIN
Pragma: no-cache
Cache-control: no-store, no-cache, must-revalidate, private
Expires: Thu, 04 Aug 2016 12:58:01 GMT
X-Content-Type-Options: nosniff
Vary: User-Agent,Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=30, max=29977
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/javascript;charset=UTF-8
Set-Cookie: BIGipServerjob_iad=!WcxX2VJ58OOojFQRNhs+rOzpOInz86YFI2BZzMsbv9orNwX4rj5v6T936m7gDvyWulSDIiDuepFONA==; path=/

最佳答案

我基本上通过使用服务器端语言(在本例中为 Java)向 api 发出请求来修复它。这解决了问题。

这可能是设计使然,因此客户端看不到发布商 ID。

关于javascript - Indeed API 访问控制允许来源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38768145/

相关文章:

javascript - 跳过 Javascript 数组中的空格

jquery - 限制用户在具有数据属性的插槽中重复颜色

html - 在表格单元格中显示消息

ruby-on-rails - Rails 简单访问控制

javascript - JQuery Mobile 3 下拉日期选择器?

javascript - 将我所有的 .js 分组到一个文件中 - 好主意吗?

javascript - 如何在 angularjs 中使用 Controller 内部的 Promise?

javascript - AngularJS 中的下拉菜单

amazon-web-services - 控制从我的应用程序对 AWS S3 文件的访问

node.js - GraphQL - 如何区分公共(public)字段和私有(private)字段?