# BASH

# Send a file
echo "My content" > myfile.txt
curl https://hastebin.app/v2/paste -X POST -H 'Content-Type: text/plain'  --data-binary @myfile.txt

# Send direct text
curl https://hastebin.app/v2/paste -X POST -H 'Content-Type: text/plain'  --data-binary 'my content'

# Send from stdin
echo "my-stdin" | curl https://hastebin.app/v2/paste -X POST -H 'Content-Type: text/plain'  --data-binary @-
# NODE - FETCH
let content = `
This is line 1.
This is line 2.
Line 3.
`

fetch("https://hastebin.app/v2/paste", {
  "headers": { "Content-Type": "text/plain" },
  "body": content,
  "method": "POST"
})
.then(res => res.json())
.then(d => console.log(d.html))