[Freeipa-devel] Communicating with FreeIPA via curl

Adam Young ayoung at redhat.com
Thu Jul 22 18:43:57 UTC 2010


On 07/22/2010 08:16 AM, Simo Sorce wrote:
> On Wed, 21 Jul 2010 16:13:12 -0400
> Adam Young<ayoung at redhat.com>  wrote:
>
>    
>> The web UI uses  JSON RPC to talk to the server.  As I look at
>> implement more and more functionality, I find I want to see the JSON
>> messages much the same way that the ipa command line can show the
>> XML-RPC messages.  A little trial and error and I got it working:
>>
>>
>> curl -v  \
>>            -H "Content-Type:application/json" \
>>            -H "Accept:applicaton/json"\
>>            --negotiate -u : \
>>            --cacert /etc/ipa/ca.crt  \
>>            -d
>> "{\"method\":\"user_find\",\"params\":[[\"\"],{}],\"id\":0}"   \ -X
>> POST       https://`hostname`/ipa/json
>>      
> You can avoid escaping every single quote with single quotes:
> '{"method":"user_find","params":[[""],{}],"id":0}'
>    

Thanks for the clue-bat.  I should have done that in the first place.

> Also the ca.crt is available via HTTP iIrc, you just have to download
> it once.
>
>    
>> Here's the explanation if you want it.
>>
>> http://adam.younglogic.com/?p=897
>>      
> Nice post.
>
> Simo.
>
>    




More information about the Freeipa-devel mailing list