[Freeipa-devel] Communicating with FreeIPA via curl
Rob Crittenden
rcritten at redhat.com
Thu Jul 22 13:04:17 UTC 2010
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}'
>
> Also the ca.crt is available via HTTP iIrc, you just have to download
> it once.
This doesn't download it, it points curl to the existing CA cert on the
filesystem.
rob
More information about the Freeipa-devel
mailing list