-
Notifications
You must be signed in to change notification settings - Fork 643
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
refactor: Decouple HTTP client #2661
base: master
Are you sure you want to change the base?
Conversation
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.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
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.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
So if I understand this correctly, we cannot get rid of Does it mean we have to model the In |
Also, a completely unrelated thought / nit, but what file and directory casing convention are we following in Crawlee? It's already messy in the current codebase, but seeing |
Well, yeah, since got is part of our public API, we cannot completely remove it 🤷. We'll see what our default http client for 4.0 will be.
Not really, but I'd prefer to implicitly support got stuff that won't be part of the http client interface (e.g.,
Well, I didn't notice any, so I just look at the nearest files and do my best effort. |
Historically things were snake case, but I believe nobody from the current team is in favor of that (I never like this). I would go with kebab case for anything new, and unify in v4 maybe (or sooner, I don't think it has any effect downstream, we don't allow deep imports anywhere). |
/** | ||
* HTTP Request as accepted by {@apilink BaseHttpClient} methods. | ||
*/ | ||
export interface HttpRequest<TResponseType extends keyof ResponseTypes = 'text'> { |
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.
We may not want to keep this. If people use responseType
in current sendRequest
, the type is incorrect anyway. And I'd guess that using e.g., gotScraping({...}).json()
is more prevalent anyway.
See https://gist.github.com/janbuchar/3a4724927de2c3a0bb16c46bb5940236 for an example curl-impersonate client.
The following got-scraping options were ignored (they will still work, but they're not part of the new interface):