Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpie adding quotes causing invalid json ? #345

Closed
imiten opened this issue Apr 28, 2015 · 1 comment
Closed

httpie adding quotes causing invalid json ? #345

imiten opened this issue Apr 28, 2015 · 1 comment

Comments

@imiten
Copy link

imiten commented Apr 28, 2015

Hi,

I am trying to send json as body and it seems its formatting json with additional quotes.

I am on cygwin on windows 7.

http --verbose --json --pretty all POST $URL_WS_JW/accounts/registration $api_headers  <<-REQ
{"lastName":" ","coreContainerUUID":"$ccuuid","osVersion":"4.2.1","deviceName":"iris506Q","notificationType":"gcm","deviceType":"PHONE","gender":"M","birthDate":"1970-01-01","firstName":"Miten Mehta","rilUID":"mitenmehta","deviceOS":"ANDROID"}
REQ

POST /jioworld-webservice/accounts/registration HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Content-Length: 306
Content-Type: application/json
Host: 10.135.128.92:8080
User-Agent: HTTPie/1.0.0-dev
corecontaineruuid: httpccuuid280420151449
jioworld-api-key: 123456
lbcookie: 4
ssotoken: AQIC5wM2LY4Sfcx5-1hSZ-vXUQ0aM2Q6deYKo55Q9cz-B4k.AAJTSQACMDIAAlNLABQtODk2NDM2OTc1OTA1NTI3MjM3NgACUzEAAjAz
x-api-key: l7xx2d6db0dd9848443bb2c5528d533cb3ad

"{"lastName":" ","coreContainerUUID":"httpccuuid280420151449","osVersion":"4.2.1","deviceName":"iris506Q","notificationType":"gcm","deviceType":"PHONE","gender":"M","birthDate":"1970-01-01","firstName":"Miten Mehta","rilUID":"mitenmehta","deviceOS":"ANDROID"}\n"

HTTP/1.1 400 Bad Request
Connection: close
Content-Length: 93
Content-Type: application/json
Date: Tue, 28 Apr 2015 12:16:05 GMT
Server: APPSERV

{
"errorCode": "30",
"errorMessage": "Invalid JSON format",
"errorType": "JIOWORLD_REST_EXCEPTION"
}

@jkbrzt
Copy link
Member

jkbrzt commented Apr 28, 2015

I believe this is the same bug that has been fixed in #337, which will be included in the next release of HTTPie.

For the current version of HTTPie (<= 0.9.2): The problem goes away when you remove --json (which is actually superfluous in your case).

@jkbrzt jkbrzt closed this as completed Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants