question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrectly parsing JSON

See original GitHub issue

Hey,

First of all, httpie is a magnificent piece of software. I can’t remember how many colleagues I recommended using it.

There’s a problem I’ve encountered. According to the spec providing JSON params is done via the := operator. But launching httpie 0.9.9 with these params:

http post localhost/example/ param1="a b c" param2=d jparam:='["test string"]'

Results in a message about invalid JSON. But ["test string"] is valid JSON afaik.

http: error: "jparam:='[test string]'": Expecting value: line 1 column 1 (char 0)

Maybe anyone could shed some line on what seems to be wrong?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
agriffiscommented, Jul 19, 2017

@poskadesign Try this:

http post localhost/example/ param1="a b c" param2=d jparam:="[\"test string\"]"

I’m not very familiar with Windows command line, but found https://stackoverflow.com/questions/17205292/quotes-around-quotes-in-windows-command-line which is similar.

1reaction
rwishcommented, Jun 27, 2017

Hi, I’m a newbie to open source projects. I would like work on this issue. Could you please provide me with more info?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >
Parse incorrect JSON - Stack Overflow
A quick and easy way would be to try parse the string starting with 1 character and adding characters one by one until...
Read more >
SyntaxError: JSON.parse: bad parsing Breaking Your Code ...
In JavaScript, when passing JSON to the JSON.parse() method, the method expects properly formatted JSON as the first argument. When it detects ...
Read more >
How to Parse Improperly Formatted JSON Objects in Databricks
Therefore, the problem to solve is to take an invalid text file with valid JSON objects and properly format it for parsing.
Read more >
Error while parsing JSON Response in REST API Post call
I am using Outsystems 10 and trying to consume a REST API (single method). I have copied and pasted the REST Request and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found