Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Curl question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Fri Oct 25, 2013 9:31 am    Post subject: [SOLVED] Curl question Reply with quote

I am having some trouble extracting a json array from a site using curl.
My attempts appear to be failing at the authentication stage, it obviously must be due to my malformed curl command.

The below example works fine from a browser:

Code:
 https://www.xyz.xyz/api/json/fdr?client.serial=12345&auth=password


This is my curl version which does not work:

Code:
curl -i -sslv3 -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"client.serial":"12345", "auth":"password"}' https://www.xyz.xyz/api/json/fdr


The error I recieve from the server when attempting with curl is as below, I can get the exact same error in the browser by passing in bad auth credentials

Code:
{"error":{"message":"Authentication failed","description": ....


Any ideas where Im going wrong?


Last edited by chiefbag on Fri Oct 25, 2013 1:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
chiefbag
Guru
Guru


Joined: 01 Oct 2010
Posts: 542
Location: The Kingdom

PostPosted: Fri Oct 25, 2013 1:50 pm    Post subject: Reply with quote

Well looks like an easy way to construct curl queries is to use the developer tools in google-chrome :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum