今天开始使用request发起接口请求,代码如下:
运行后输出结果如下:
E:\Python\python.exe D:/PycharmProjects/Airf_auto/exercise/bill_insert.py
{
"errorCode":500,"globalMessage":"JSON parse error: Unrecognized token 'waybillType': was expecting ('true', 'false' or 'null'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'waybillType': was expecting ('true', 'false' or 'null')\n at [Source: (PushbackInputStream); line: 1, column: 13]","payload":null,"errorMessageList":[]}
进程已结束,退出代码为 0
同样的代码在APIpost上可以跑通,一番研究,最终确定出错原因及解决方法。