RobotFramework_Python_API: получение «исключения»: «com.fasterxml.jackson.core.JsonParseException» для запроса на публик ⇐ Python
RobotFramework_Python_API: получение «исключения»: «com.fasterxml.jackson.core.JsonParseException» для запроса на публик
I am trying to execute a Post request using Python RobotFramework in Pycharm. On execution I keep getting the "exception":
com.fasterxml.jackson.core.JsonParseException.
Code being executed
TC2: Testing_createDict ${auth}= Create List Bxxxxxx xxxxxxxxxxxx Create Session mysession ${base_url} auth=${auth} ${entry}= Create Dictionary Lot Status Code=C Item Number=95544403 Lot Expiration Date=09222021 Branch Plant=QIO Lot Description=BSIC-2022-001 Lot Number=185 ${lot master}= Create List ${entry} ${body}= Create Dictionary Item Lot Check (Y/N)=N Lot Master=${lot master} ${header}= Create Dictionary Content-Type=application/json ${response}= POST On Session mysession /jderest/orchestrator/58_XXXXX_XXXX_ORCH data=${body} headers=${header} Log To Console ${response.status_code} Output:
[info (+0.25s)] POST Request : url=https://xxxxx//xxx headers={'User-Agent': 'python-requests/2.28.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '182', 'Authorization': 'Basic xxxxxxxxxxxx'} body=Item+Lot+Check+%28Y%2FN%29=N&Lot+Master=Lot+Status+Code&Lot+Master=Item+Number&Lot+Master=Lot+Expiration+Date&Lot+Master=Branch+Plant&Lot+Master=Lot+Description&Lot+Master=Lot+Number [info] POST Response : url=https://xxxxxxxxx status=500, reason=Internal Server Error headers={'Date': 'Wed, 06 Mar 2024 15:09:46 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '425', 'Connection': 'keep-alive', 'Set-Cookie': 'XXXXX; Expires=Wed, 13 Mar 2024 15:09:46 GMT; Path=/, AWSALBCORS=XXXXXXXXX; Expires=Wed, 13 Mar 2024 15:09:46 GMT; Path=/; SameSite=None; Secure', 'X-ORACLE-DMS-ECID': 'xxx--xx-xxxx-xxxxx', 'X-ORACLE-DMS-RID': '0', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', 'Access-Control-Allow-Origin': '*'} body={ "message" : "Unrecognized token 'Item': was expecting 'null', 'true', 'false' or NaN\n at [Source: (String)\"Item+Lot+Check+%28Y%2FN%29=N&Lot+Master=Lot+Status+Code&Lot+Master=Item+Number&Lot+Master=Lot+Expiration+Date&Lot+Master=Branch+Plant&Lot+Master=Lot+Description&Lot+Master=Lot+Number\"; line: 1, column: 5]", "exception" : "com.fasterxml.jackson.core.JsonParseException", "timeStamp" : "2024-03-06:23.09.46" }
Источник: https://stackoverflow.com/questions/781 ... n-core-jso
I am trying to execute a Post request using Python RobotFramework in Pycharm. On execution I keep getting the "exception":
com.fasterxml.jackson.core.JsonParseException.
Code being executed
TC2: Testing_createDict ${auth}= Create List Bxxxxxx xxxxxxxxxxxx Create Session mysession ${base_url} auth=${auth} ${entry}= Create Dictionary Lot Status Code=C Item Number=95544403 Lot Expiration Date=09222021 Branch Plant=QIO Lot Description=BSIC-2022-001 Lot Number=185 ${lot master}= Create List ${entry} ${body}= Create Dictionary Item Lot Check (Y/N)=N Lot Master=${lot master} ${header}= Create Dictionary Content-Type=application/json ${response}= POST On Session mysession /jderest/orchestrator/58_XXXXX_XXXX_ORCH data=${body} headers=${header} Log To Console ${response.status_code} Output:
[info (+0.25s)] POST Request : url=https://xxxxx//xxx headers={'User-Agent': 'python-requests/2.28.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '182', 'Authorization': 'Basic xxxxxxxxxxxx'} body=Item+Lot+Check+%28Y%2FN%29=N&Lot+Master=Lot+Status+Code&Lot+Master=Item+Number&Lot+Master=Lot+Expiration+Date&Lot+Master=Branch+Plant&Lot+Master=Lot+Description&Lot+Master=Lot+Number [info] POST Response : url=https://xxxxxxxxx status=500, reason=Internal Server Error headers={'Date': 'Wed, 06 Mar 2024 15:09:46 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '425', 'Connection': 'keep-alive', 'Set-Cookie': 'XXXXX; Expires=Wed, 13 Mar 2024 15:09:46 GMT; Path=/, AWSALBCORS=XXXXXXXXX; Expires=Wed, 13 Mar 2024 15:09:46 GMT; Path=/; SameSite=None; Secure', 'X-ORACLE-DMS-ECID': 'xxx--xx-xxxx-xxxxx', 'X-ORACLE-DMS-RID': '0', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', 'Access-Control-Allow-Origin': '*'} body={ "message" : "Unrecognized token 'Item': was expecting 'null', 'true', 'false' or NaN\n at [Source: (String)\"Item+Lot+Check+%28Y%2FN%29=N&Lot+Master=Lot+Status+Code&Lot+Master=Item+Number&Lot+Master=Lot+Expiration+Date&Lot+Master=Branch+Plant&Lot+Master=Lot+Description&Lot+Master=Lot+Number\"; line: 1, column: 5]", "exception" : "com.fasterxml.jackson.core.JsonParseException", "timeStamp" : "2024-03-06:23.09.46" }
Источник: https://stackoverflow.com/questions/781 ... n-core-jso
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Com.fasterxml.jackson.core.JsonParseException: неверный стартовый байт UTF-8 0x92
Anonymous » » в форуме JAVA - 0 Ответы
- 21 Просмотры
-
Последнее сообщение Anonymous
-