gpt4 book ai didi

java - 需要一个字符串,但在 Easypost 发货中的第 1 行第 123 行路径 $.options 处为 BEGIN_OBJECT

转载 作者:行者123 更新时间:2023-12-02 04:51:00 25 4
gpt4 key购买 nike

我正在使用 Easy Post API 将货件集成到我的应用程序中,当我使用 shipment.create(shipmentMap, EASYPOSTAPIKEY) 时,它会抛出错误预期是一个字符串,但实际上是 BEGIN_OBJECT在第 1 行第 123 列路径 $.options.

Map<String, Object> parcelMap = new HashMap<String, Object>();
parcelMap.put("predefined_package", "FlatRateEnvelope");
parcelMap.put("weight", 10);
Parcel parcel = Parcel.create(parcelMap);
Map<String, Object> shipmentMap = new HashMap<String, Object>();
shipmentMap.put("to_address", toAddress);
shipmentMap.put("from_address", fromAddress);
shipmentMap.put("parcel", parcel);
Shipment shipment = Shipment.create(shipmentMap, EASYPOSTAPIKEY);

java.lang.IllegalStateException: Expected a string but wasBEGIN_OBJECT at line 1 column 123 path $.options.atcom.google.gson.stream.JsonReader.nextString(JsonReader.java:825)~[gson-2.8.5.jar:na]

最佳答案

更新最新版本的 Easy Post 客户端 API 应该可以解决此问题。

关于java - 需要一个字符串,但在 Easypost 发货中的第 1 行第 123 行路径 $.options 处为 BEGIN_OBJECT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56442010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com