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

Multiple SMS messages sent with a single instance of the client fail #2

Open
SteppingHat opened this issue Aug 11, 2024 · 1 comment

Comments

@SteppingHat
Copy link

When using a single instance of the client across multiple requests, any SMS messages sent after the first message fail.

{"level":"debug","REST CLIENT":"Do","time":"2024-06-20T18:37:00+10:00","message":"Sending POST request to https://api.smsglobal.com/v2/sms"}
...
{"level":"debug","REST CLIENT":"Do","time":"2024-06-20T18:38:00+10:00","message":"Sending POST request to https://api.smsglobal.com/v2/sms/sms"}
...
{"level":"debug","REST CLIENT":"Do","time":"2024-06-20T18:39:00+10:00","message":"Sending POST request to https://api.smsglobal.com/v2/sms/sms/sms"}

This seems to be due to incorrectly mutated state, specifically the path, where appending "/sms" is done for each request, irrespective of it's currently stored value.

A workaround for this is to specifically set reset BaseURL before each request.

@SteppingHat
Copy link
Author

I've opened PR #1 to address this issue

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

No branches or pull requests

1 participant