Skip to main content
Question

HTTP Collection : parse headers values

  • June 30, 2025
  • 3 replies
  • 40 views

FredericGerard
Forum|alt.badge.img+7

Hi,

 

Here’s the matter : to get metrics from an API one has first to request the “login” endpoint, providing user and password, to get back an authentication token (with a limite time validity). BUT this token is provided in the header “Authorization”, not in the json body of the response, and I didn’t manage to get it.

Is there a way to extract values of the header ?

Thx.

3 replies

ltirand
Centreonian
Forum|alt.badge.img+10
  • Centreonian
  • July 3, 2025

Hello :)

Have you try to use the --debug option? In regular plugins it shows header’s contain.

Kind regards

 


FredericGerard
Forum|alt.badge.img+7

Hi,

I did, saw the header and its content
=> Recv header: HTTP/1.1 200 OK
...
=> Recv header: Authorization: Bearer xxx
=> Recv header: Set-Cookie: skylight-aaa=xxx

But I didn’t manage to grab it and its value in the “parse” section of the collection file 🙁.

Regards


FredericGerard
Forum|alt.badge.img+7

OK, definitively not possible with present version.
Idea submitted for plugin evolution :
 

If you like it, vote for it :-)