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

Can't intercept requests on 'send()' method #40

Closed
chinloyal opened this issue Sep 7, 2020 · 6 comments
Closed

Can't intercept requests on 'send()' method #40

chinloyal opened this issue Sep 7, 2020 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@chinloyal
Copy link

I am using an API that has an odd DELETE request endpoint where I have to pass a body to it, the default delete method doesn't have an option to pass a body so I have to create a custom request then pass it like this client.send(request), the problem is the interceptor doesn't seem to intercept these requests on the client, and so my default headers are left blank.

Is there a way to intercept this type of request without having to manually add the headers to the custom request?

@issue-label-bot
Copy link

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

@CodingAleCR CodingAleCR self-assigned this Sep 7, 2020
@CodingAleCR CodingAleCR added the bug Something isn't working label Sep 7, 2020
@CodingAleCR
Copy link
Owner

Hmm, to be honest, right now there's no way to achieve this other than extending the class and using your own extension for it. I do plan to support the send method call, right now it's mostly an escape hatch and not fully supported. I'm sorry that I cannot be of more assistance with your case, but I'd be down to a call if you need it. Cheers and thanks for the issue!

@CodingAleCR CodingAleCR added question Further information is requested and removed bug Something isn't working labels Sep 7, 2020
@CodingAleCR
Copy link
Owner

I have added this to the backlog, I will close the issue now.

@sunnykinger
Copy link

I faced the same problem. Headers were not attached to send call

@CodingAleCR
Copy link
Owner

Hi, yes, as pointed in the plugin's read me, the usage of the send method is not supported yet, I am working to achieve this, it takes quite an effort since I might need to clone every type of request to properly intercept it. I'm sorry for the many inconveniences this has caused.

@CodingAleCR
Copy link
Owner

Using send method was added on #98 and to the 2.0.0 beta, feel free to try it out if you want ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants