You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am using react remix to send requests to a REST API that I generate the typescript client for.
My goal is to pass cookie headers from the browser to the API client functions, with the ability to dynamically set these headers for each individual request. Since Remix’s backend is shared between users, setting headers globally across requests isn’t feasible. I need a way to pass in specific headers on a per-request basis.
Is there a way to modify the generator configuration to automatically add a headers parameter to each function, which would then be passed to the request function? This way, I can dynamically set the headers for each API call.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am using react remix to send requests to a REST API that I generate the typescript client for.
My goal is to pass cookie headers from the browser to the API client functions, with the ability to dynamically set these headers for each individual request. Since Remix’s backend is shared between users, setting headers globally across requests isn’t feasible. I need a way to pass in specific headers on a per-request basis.
I am using the axios client.
I need to generate something like this:
Is there a way to modify the generator configuration to automatically add a
headers
parameter to each function, which would then be passed to the request function? This way, I can dynamically set the headers for each API call.Thanks in advance for any help!
Beta Was this translation helpful? Give feedback.
All reactions