restful-react icon indicating copy to clipboard operation
restful-react copied to clipboard

How to use mutate with async response status 202 and read response location header

Open enverbisevac opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. For example you POST some data for long running job and you get back 202 Accepted with Location header in response, how can I read this value from useMutate or open api generated code?

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

enverbisevac avatar Oct 21 '20 20:10 enverbisevac

The callback you get returned from useMutate returns a promise that resolves with data from the response.

It might be a good idea to also return the entire response object if we don't already to allow reading headers.

TejasQ avatar Oct 22 '20 18:10 TejasQ