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

intercept page http requests and provide custom http responses #119

Merged
merged 1 commit into from
Jan 28, 2019
Merged

intercept page http requests and provide custom http responses #119

merged 1 commit into from
Jan 28, 2019

Conversation

devonsams
Copy link
Contributor

When making a request for a screenshot, I wanted the ability to pass along any data the page may request. This way I can avoid the round trip to any rest apis the page may be calling and provide the data directly from Browserless. Let me know what you think about this.

@joelgriffith
Copy link
Collaborator

This looks great, and thanks for the tests as well! I’m curious about your thoughts on when using this API, versus something like the function API? Reason I ask is that it’s probably easier to grok what’s going on in the function API versus having to read implementation details here for newcomers.

Overall this looks a great, and I might apply it to the two other APIs that share a similar interface!

@joelgriffith joelgriffith merged commit 2f34fe3 into browserless:master Jan 28, 2019
@devonsams
Copy link
Contributor Author

I definitely like having the function API as a fallback option. It's nice, however, to be able to provide a clean API that the rest of the infrastructure on my end can interact with directly, without having to introduce or modify another a service to act as a middle layer. I understand wanting to keep the functionality here free of bloat though, and if that's the strategy, I guess it's just a matter of deciding where to draw the line.

Thanks for approving this though! Sorry for missing those console.logs.

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

Successfully merging this pull request may close these issues.

2 participants