【问题标题】:Invalid cookie header: Airtable无效的 cookie 标头:Airtable
【发布时间】:2021-02-24 18:15:22
【问题描述】:

我正在尝试使用 Java library 从 Airtable 中的特定视图中选择一条记录

到目前为止,我已经设置了断点来检查是否一切都已初始化并且似乎没问题。我的 api 密钥正确,Airtable 实例设置正确。

 Airtable airtable = new Airtable().configure(AIRTABLE_API_KEY);
 Base basebase = airtable.base("my-airtable-base");

这是我的错误:

Nov 12, 2020 5:53:08 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: brw=brwkel6HWNoWVEl49; path=/; expires=Fri, 12 Nov 2021 17:53:08 GMT; domain=.airtable.com; samesite=none; secure; httponly". Invalid 'expires' attribute: Fri, 12 Nov 2021 17:53:08 GMT
Exception in thread "main" com.sybit.airtable.exception.AirtableException: {"error":"NOT_FOUND"} (UNDEFINED_ERROR) [Http code 404]
    at com.sybit.airtable.exception.HttpResponseExceptionHandler.onResponse(HttpResponseExceptionHandler.java:29)
    at com.sybit.airtable.Table.select(Table.java:206)
    at com.sybit.airtable.Table.select(Table.java:327)
    at com.hived.AirtableInstance.selectTableView(AirtableInstance.java:43)
    at com.hived.Main.main(Main.java:25)

这是导致错误的函数:

  public void selectTableView() throws AirtableException, HttpResponseException {
        List<Bus> stops = base.table("Bus").select("Stops");
    }

我希望它能够将公交车表中的所有站点都传递到站点列表中。

我不确定自己做错了什么,因此我们将不胜感激。

【问题讨论】:

  • “这是导致错误的函数”是什么意思?我在堆栈跟踪中没有看到它。 - 看起来selectARecord 是你的罪魁祸首。
  • 对不起@Steve,输入了错误的堆栈跟踪。现在更新了。

标签: java airtable


【解决方案1】:

原来你需要做一些事情。

  1. 将 log4j 添加到您的项目中
  2. 将 slf4j-simple 添加到您的项目中

一旦添加了这些依赖项。您现在应该看到没有警告了。

现在删除错误。事实证明,您需要调用基本 ID,而不是引用基本名称。

base = airtable.base("applJilugnJCtDRdh");

就是这样!希望这对其他人有帮助。

【讨论】:

    猜你喜欢
    • 2016-08-08
    • 2023-02-25
    • 1970-01-01
    • 2012-10-09
    • 1970-01-01
    • 2013-05-19
    • 2017-03-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多