Comments (4)
Have this implemented off in the jsonp
branch - let me know if this fits the bill
Thanks for the feature request
from haste-server.
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.
from haste-server.
Ahh I think I may have misunderstood the original goal.
The branch will allow retrieval of haste data for a given key via JSONP
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
from haste-server.
Please re-open if any other questions!
from haste-server.
Related Issues (20)
- healthcheck in docker file need a shell HOT 2
- [QUESTION] what exactly is STORAGE_EXPIRE_SECONDS? HOT 2
- Add Font Awesome icons instead of the image thing. HOT 2
- Reopen request HOT 1
- Hastebin IPFS Support HOT 2
- Disable automatic closing of issues HOT 1
- self-hosted instace, buttons greyed out
- nginx config need help please HOT 1
- alpine image HOT 2
- Tried to host haste-server on a Plesk webspace, error occured HOT 2
- 503 error while post in /documents HOT 2
- daemonize haste-server HOT 3
- Important announcement: Soon a new version of Hastebin will be launched! HOT 15
- bun
- Haste server sends 413 for requests over 1mb
- Release containers in a public repo HOT 5
- Authentication failed (MongoDB) HOT 2
- pastebin HOT 1
- 1. Remove deprecation warning from existing trading-api hybrid websocket endpoint. HOT 3
- this lost almost all of the reasons why it was any good in the refactor. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haste-server.