-
Notifications
You must be signed in to change notification settings - Fork 80
Method setRequestMethodNonBulk() added to allow (non bulk) POST requests #71
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
Conversation
Would be able to solve #43 |
Thanks @silvershadowcc btw there will be likely still few more changes needed so that the token actually gets posted and not sent through a URL query parameter. |
added warning about redirects for setRequestMethod()
prevent method from being set to GET while doing Bulk Requests
Sorry, I assumed that the parameters would actually be posted haha. Changed it, this works. As stated in the commit: URL is spliced in URL and parameters which are now fed to the POST payload for both cURL and stream. |
The namings are all good @silvershadowcc 👍
I wonder if any one would use any other kind of request methods like I'll try to test this in the next days @silvershadowcc looking only at the code it looks good. The next step after this would be to see if we can somehow make POST the default for the
and someone else can then replay these actions. Vs with a POST of all parameters we would only see We would already POST the token by default. However, we can do this only once we make sure redirected URLs get the value posted as well. |
Snake case converted to camel case. Reverted back to the method selection of 'POST' (intended). Added a warning about Log Analytics.
Went back to the previous selection of POST as string. Currently no other methods would be supported since they may require different input for cURL and stream. Converted snake to camel casing and added the warning. Thanks for the background. Making sure that redirected URLs get the POST values might be as easy as using
Do you mean sending a POST request with the token_auth as payload, but everything else still as GET? If so, it would be just as easy to implement it that way now (and fixing the potential redirect problem). The preferred method for this would be to use a GET request with HTTP Authorization header though, which would bring us back to #matomo-org/matomo#7349 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silvershadowcc looking good. It worked for me. Left one more comment before merging. Basically we need to rename a method. I started working on the final solution with security by default in mind in #72
I had to start working on this to make sure by merging this we won't need to change everything again later when we develop the "security by default" solution. Otherwise we would have needed to provide eg backwards compatibility for this new public method etc even though it would have been barely used. But the method will still be needed later so it's all good.
If after merging this you are keen on giving #72 a try feel free to go ahead.
Tomorrow :) But I can't test bulk. I added that only POST and GET are supported for docs in the latest commit. |
Thanks @silvershadowcc |
POST was already supported, because it's used for BulkTrack. This method should provide the option to choose POST in other scenarios (when using setTokenAuth for increased security for example).