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

Custom Content-Type for HTTP Request #1926

Open
derTuca opened this issue Mar 3, 2025 · 4 comments
Open

Custom Content-Type for HTTP Request #1926

derTuca opened this issue Mar 3, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@derTuca
Copy link

derTuca commented Mar 3, 2025

I'd like to send an application/ld+json body

Describe the solution you'd like
Being able to set a Custom content-type via a separate input that displays when I'd select the Custom content-type option

Describe alternatives you've considered
I've tried setting Content-Type in the Headers section but it gets overriden.

@bingren-yd
Copy link
Contributor

Hello, are you referring to modifying the header information using automaFetch within the JS Block, or are you talking about the Http Request Block?

@derTuca
Copy link
Author

derTuca commented Mar 4, 2025

Hi, I was talking about the http block.

@bingren-yd
Copy link
Contributor

Yes, you're absolutely right. I took a closer look at the code, and it indeed doesn't override the Content-Type. The order of the code (how it merges the values of Headers) means that if you use the "Http Request Block," its Content-Type will always be one of the four predefined options, rather than a custom value.

I'll definitely add this to my to - do list. In the meantime, you can use a JS Block to execute the corresponding request.

@bingren-yd
Copy link
Contributor

Image

Image

Additionally, there's a sort of "workaround" you could try. You can customize the header by adding a key: "content-type" and value: [your value]. This will merge the headers, and the actual request sent will look like what I've shown in the screenshot. However, I'm not sure if this will fully meet your server's requirements.

Make sure it's all lowercase: content-type.

@bingren-yd bingren-yd self-assigned this Mar 4, 2025
@bingren-yd bingren-yd added the enhancement New feature or request label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants