API
curl — create a paste
curl -X POST https://paste.erfi.io/pastes \
-H 'Content-Type: application/json' \
-d '{"content":"Hello world","expiration":86400}'curl - upload a file
curl -X POST https://paste.erfi.io/pastes \
--data-binary @file.pyfetch — JavaScript
const res = await fetch('https://paste.erfi.io/pastes', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
content: 'Hello world',
language: 'javascript',
expiration: 86400,
}),
});
const { url } = await res.json();
console.log(url);