-
Notifications
You must be signed in to change notification settings - Fork 794
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
JSONP support #47
Comments
Have this implemented off in the |
That's exciting news - thanks very much! I'm having trouble getting this feature to work with my JavaScript "client." When I try to submit data via JSONP, I get back the HTML for Hastebin rather than JSON containing a key. As a test, I tried a submitting form to my local instance of Hastebin normally, with no JavaScript. When I used POST to send the data, I received a key as expected. When I used GET to send the data, my browser navigated to http://0.0.0.0:7777/documents/?data=jhklhkljh, which gave me the HTML for Hastebin. So, it sounds like I'd need to use POST instead of GET. The problem is that JSONP works only with GET, not POST. Additionally, GET is probably not well-suited for submitting large blocks of code. Any thoughts on what might be going on here? Am I misunderstanding how to interact with haste-server? Should I be using CORS instead of JSONP? If it helps, you can see my extremely basic "client" code at https://github.com/rdebeasi/post-haste. Thanks again for your help, and my apologies if the JSONP suggestion turns out to be a bad idea. |
Ahh I think I may have misunderstood the original goal. I'm a bit wary to take in data for hastes over GET. Maybe it's an idea to offer a library you can use on your site - which is hosted on the hastebin domain to create documents (similar to the approach taken with stripe.js) which would allow for CORS Do you have some more details on your use case? There's always the ability have a smaller server that created the pastes but that may be too heavyweight |
Please re-open if any other questions! |
Javascript browser clients can now use hastebin. Fix toptal#352 Fix toptal#47
It would be great if haste-server supported JSONP, so that JavaScript-based clients could interact with it.
Hastebin rocks - thanks for creating this project!
The text was updated successfully, but these errors were encountered: