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

import function sends as a GET request #187

Open
penfold45 opened this issue Jul 6, 2021 · 3 comments
Open

import function sends as a GET request #187

penfold45 opened this issue Jul 6, 2021 · 3 comments

Comments

@penfold45
Copy link

I feel like I am missing something. It looks to me as though import() sends the request as a GET request
when it should be a POST request according to the docs

The import function calls send_event_request() which is always a get request
as it does this metrics.send_request({ method: "GET", endpoint: endpoint, data: data }, callback);

Can someone point me in the right direct on what I am doing wrong?

Thanks

@tdumitrescu
Copy link
Member

The API will accept either GET or POST. For importing a single event with mixpanel.import(), the GET should work fine. If you want to send very large payloads or multiple events at once, you can use import_batch() which uses POST under the hood.

@penfold45
Copy link
Author

Is this not bad from a data leakage point of view as posting data with a GET request will mean the data is more likely to end up in log files.

@tdumitrescu
Copy link
Member

That's a concern if you run your own tracking proxy and log all query params and are worried about your event payloads ending up in your internal logs. For Mixpanel's official ingestion API (api.mixpanel.com), we don't do that kind of logging.

That said, at this point there's no downside to converting this whole lib to use POST, pull requests welcome.

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

2 participants