You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i try to import cUrl with escape symbols curl -X POST 'https://example.com' -H "User-Agent: loadmill/v9.92.0" -H "content-type: application/json" -d "{ \"API_KEY\": \"api_key\", \"API_SECRET\": \"secret\", \"Device\": {\"id\": \"1234567890\"} ,\"messageIds\": [\"message_1234567890\"], \"action\": \"accept\", \"raw\": \"{ \\\"test\\\": \\\"test\\\"}\" }"
i've doesn't get any error message, but if i cover safeParseJSOn function from ImportCurl component by try catch the error message is
Error SyntaxError: Unterminated string in JSON at position 173 (line 1 column 174)
at JSON.parse (<anonymous>)
at json.ts:17:25
at Module.tryCatch (chunk-7GXFONRI.js?v=4d8dafc1:400:18)
at safeParseJSON (json.ts:15:5)
at chunk-N5YTPUBR.js?v=4d8dafc1:144:25
at parseBody (contentParser.ts:192:21)
at body.ts:46:11
at chunk-7GXFONRI.js?v=4d8dafc1:222:25
at chunk-N5YTPUBR.js?v=4d8dafc1:259:19
at pipe (chunk-N5YTPUBR.js?v=4d8dafc1:212:14)
I guess the problem is somewhere in FE side, it's serialized string again and i got something like this: "curl -X POST 'https://example.com' -H \"User-Agent: loadmill/v9.92.0\" -H \"content-type: application/json\" -d \"{ \\\"API_KEY\\\": \\\"api_key\\\", \\\"API_SECRET\\\": \\\"secret\\\", \\\"Device\\\": {\\\"id\\\": \\\"1234567890\\\"} ,\\\"messageIds\\\": [\\\"message_1234567890\\\"], \\\"action\\\": \\\"accept\\\", \\\"raw\\\": \\\"{ \\\\\\\"test\\\\\\\": \\\\\\\"test\\\\\\\"}\\\" }\""
@liyasthomas
I want to try fix this issue. But when I started a solving the problem I noticed that the problem lies in the yargs-parser/browser library.
After parse @AlexNeAuto curl command I get "{ \"API_KEY\": \"api_key\", \"API_SECRET\": \"secret\", \"Device\": {\"id\": \"1234567890\"} ,\"messageIds\": [\"message_1234567890\"], \"action\": \"accept\", \"raw\": \"{ value of d parameter.
Also we have another failed curl command: curl -X POST 'http://example.com:30101/api?external_postprocessing=true' -F 'images=@"/C:/test2.png"' -F 'metadata="{\"application\": \"app\", \"sessionId\": \"559b9fad-5dd2-4bd8-a071-6f07b7bbb7b3\"}";type=application/json'
Is there an existing issue for this?
Current behavior
When i try to import cUrl with escape symbols
curl -X POST 'https://example.com' -H "User-Agent: loadmill/v9.92.0" -H "content-type: application/json" -d "{ \"API_KEY\": \"api_key\", \"API_SECRET\": \"secret\", \"Device\": {\"id\": \"1234567890\"} ,\"messageIds\": [\"message_1234567890\"], \"action\": \"accept\", \"raw\": \"{ \\\"test\\\": \\\"test\\\"}\" }"
i've doesn't get any error message, but if i cover
safeParseJSOn
function from ImportCurl component by try catch the error message isI guess the problem is somewhere in FE side, it's serialized string again and i got something like this:
"curl -X POST 'https://example.com' -H \"User-Agent: loadmill/v9.92.0\" -H \"content-type: application/json\" -d \"{ \\\"API_KEY\\\": \\\"api_key\\\", \\\"API_SECRET\\\": \\\"secret\\\", \\\"Device\\\": {\\\"id\\\": \\\"1234567890\\\"} ,\\\"messageIds\\\": [\\\"message_1234567890\\\"], \\\"action\\\": \\\"accept\\\", \\\"raw\\\": \\\"{ \\\\\\\"test\\\\\\\": \\\\\\\"test\\\\\\\"}\\\" }\""
Steps to reproduce
Import cUrl
curl -X POST 'https://example.com' -H "User-Agent: loadmill/v9.92.0" -H "content-type: application/json" -d "{ \"API_KEY\": \"api_key\", \"API_SECRET\": \"secret\", \"Device\": {\"id\": \"1234567890\"} ,\"messageIds\": [\"message_1234567890\"], \"action\": \"accept\", \"raw\": \"{ \\\"test\\\": \\\"test\\\"}\" }"
Environment
Production
Version
Self-hosted
The text was updated successfully, but these errors were encountered: