How to have cURL send 2 consecutive requests with the later user part of the former response
Nicolas Guittet via curl-users <[email protected]> Tue, 7 Apr 2026 16:25:40 +0200
| Newsgroups | gmane.comp.web.curl.general |
|---|---|
| Message-ID | <CAOKpSm0Pn9DVq4nfvD=_73xpVSmw=6o1d7Apxy-JkRU57ZWFPQ@mail.gmail.com> |
--===============0546953302416674185== Content-Type: multipart/alternative; boundary="0000000000008dfe5f064edf8f8d" --0000000000008dfe5f064edf8f8d Content-Type: text/plain; charset="UTF-8" Hi everyone here, I've dug up google enough to come here to bother you; sorry in advance if this has already been asked and answered somewhere I could not find (and sorry also for my wording; english is not my mother tongue). My concern is that I have a monitoring tool that is allowed to execute some system commands, but each command has no memory of the previous commands, so I have to figure out a way to build a single line command with pipes or whatever to reach my goal. In the current case, I'm trying to use cURL to monitor an API life status. This is pretty easy with a "no-authentication" API, but becomes complex if we want to add a preliminary "Get Access Token" step first. I already know how to separately build those 2 requests, but does cURL have a way to chain requests where a later request can use a part of a previous reply ? Thank you very much for your help. Kind regards, toxcct --0000000000008dfe5f064edf8f8d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi everyone here,<div><br></div><div>I've dug up googl= e enough to come here to bother you; sorry in advance if this has already b= een asked and answered somewhere I could not find (and sorry also for my wo= rding; english is not my mother tongue).</div><div><br></div><div>My concer= n is that I have a monitoring tool that is allowed to execute some system c= ommands,=C2=A0but each=C2=A0command has no memory of the previous commands,= =C2=A0so I=C2=A0have to figure out a way to build a single line command wit= h pipes or whatever to reach my goal.</div><div>In the current case, I'= m trying to use cURL to monitor an API life status.</div><div>This is prett= y easy with a "no-authentication"=C2=A0API, but becomes complex i= f we want to add a preliminary=C2=A0"Get Access Token" step first= .</div><div><br></div><div>I already know how to separately build those 2 r= equests, but does cURL have a way to chain requests where a later request c= an use a part of a previous reply ?</div><div><br></div><div>Thank you very= much for your help.</div><div><br></div><div>Kind regards,</div><div>toxcc= t</div></div> --0000000000008dfe5f064edf8f8d-- --===============0546953302416674185== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users Etiquette: https://curl.se/mail/etiquette.html --===============0546953302416674185==--