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

Allow additional/custom headers in request #7

Merged
merged 1 commit into from
Jun 3, 2021
Merged

Allow additional/custom headers in request #7

merged 1 commit into from
Jun 3, 2021

Conversation

t27duck
Copy link
Contributor

@t27duck t27duck commented Jun 3, 2021

This change allows for the user to specify additional headers in the request object.

const request = new Request('post', 'localhost:3000/my_endpoint', { 
  body: { name: 'Request.JS' }, 
  headers: { 'X-Custom-Header': '...' } 
})

Anything in the headers option is merged into the preset headers. Last one in wins, so this should also allow for overriding defaults if desired.

This change allows for the user to specify additional headers in the request object.

```
const request = new Request('post', 'localhost:3000/my_endpoint', { body: { name: 'Request.JS' }, headers: { 'X-Custom-Header': '...' } })
```

Anything in the `headers` option is merged into the preset headers. Last one in wins, so this should also allow for overriding defaults if desired.
@marcelolx marcelolx merged commit cfeb34d into rails:main Jun 3, 2021
@marcelolx
Copy link
Collaborator

Thank you @t27duck

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.

2 participants