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

feat: header in http processor #1788

Merged
merged 10 commits into from
Feb 28, 2024
Merged

feat: header in http processor #1788

merged 10 commits into from
Feb 28, 2024

Conversation

harshdoesdev
Copy link
Contributor

@harshdoesdev harshdoesdev commented Feb 27, 2024

Users can pass request headers as processor arguments. Header keys are keys that match this pattern: $header-[key-name]$. For example, $header-authorization$ can be used to set the Authorization header of a request (as suggested by @Arpita-Jaiswal).

-- import: fastn/processors as pr


-- create-post-response response:
$processor$: pr.http
method: POST
url: /blog/new/
$header-authorization$: Bearer auth-token


-- ftd.text: $response.message

@amitu
Copy link
Contributor

amitu commented Feb 27, 2024

@harshdoesdev lets make this: $header-authorization$: Bearer auth-token instead. If tomorrow someone wants to send header-name or something as normal POST parameter they will end up sending wrong header.

@harshdoesdev harshdoesdev added the In Progress Development is in progress label Feb 28, 2024
fastn-core/src/http.rs Outdated Show resolved Hide resolved
@harshdoesdev harshdoesdev removed the In Progress Development is in progress label Feb 28, 2024
@amitu amitu merged commit 8e9c3b3 into main Feb 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants