Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add per request functionality to add HTTP request headers #756

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

111andre111
Copy link
Contributor

Feature statement

Adds functionality to configure headers on a per request statement
Syntax example:

<requestname>:
  versions:
    ">= <stackversion>":
      url: "<api url"
      extra-headers:
        <header1>: "<header1value"
        <header2>: "<header2value" 

Checklist

extra-headers:
  elastic-api-version: "2023-10-31"
  • I have verified that the local headers in {kibana|elastic|logstash}-rest.yaml overwrite the global header functionality

Fixes #657

@111andre111 111andre111 requested a review from pickypg as a code owner October 8, 2024 15:44
RestEntry restEntry = new RestEntry(name, subdir, extension, retry, url, showErrors, pageableFieldName, spaceAware);

// Logic for handling extra-headers, if they exist, after RestEntry is created
if (info.containsKey("extra-headers")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a downside to just extracting the headers during creation, like we do with spaceAware for example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set new header for diag requests to Kibana on serverless
2 participants