- From: Noah Kantrowitz <
>
- To:
- Subject: [chef] Re: capturing http response
- Date: Mon, 16 Jun 2014 14:54:48 -0700
Resources don't have return values like this, so you would want to use a
ruby_block (or LWRP) along with Net::HTTP or a similar HTTP client library.
You can use Chef::HTTP as a convenient wrapper client that already has stuff
like HTTPS verification set up (if configured in client.rb, which it should
be):
Chef::HTTP('
https://hostname').get('/path').to_s
--Noah
On Jun 16, 2014, at 9:44 AM,
<
>
wrote:
>
I'm trying to send a post request to an HTTP server and capture some parts
>
of
>
the json response in a chef resourse to use in a follow up HTTP request.
>
I've
>
found http://docs.opscode.com/resource_http_request.html which seems great
>
to
>
do the first post, but I'm having trouble finding documentation/explanation
>
about capturing the response body for the request. Anyone have any
>
pointers?
>
>
Thanks,
>
-ryan
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
Archive powered by MHonArc 2.6.16.