Procedure specific custom request headers
Problem
Discussed in https://github.com/trpc/trpc/discussions/2017 <div type='discussions-op-text'> <sup>Originally posted by skovhus June 17, 2022</sup> From the documentation and code example it seems like Client side HTTP headers can only be configured in the tRPC client and not call site when doing a query or mutation. But there are use cases where you want to pass in specific headers for a single procedure. What is the recommended way here? Is that something we lack support for? Example use case: Elevated privileges that would update the authorization header for a single procedure. </div>
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Procedure specific custom request headers
cc @zomars @abhayvatsa @leog The question to answer is _"How do we handle when a specific procedure should be called with custom headers?"_ Please read through the thoughts above 🙏
Trust Score
3 verifications
- 1
The question to answer is _"How do we handle when a specific procedure should be
The question to answer is _"How do we handle when a specific procedure should be called with custom headers?"_
- 2
Please read through the thoughts above 🙏
Please read through the thoughts above 🙏
Validation
Resolved in trpc/trpc GitHub issue #2018. Community reactions: 2 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep