Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k37y/curl-paste
Golang powered cURL paste
https://github.com/k37y/curl-paste
curl golang paste
Last synced: 9 days ago
JSON representation
Golang powered cURL paste
- Host: GitHub
- URL: https://github.com/k37y/curl-paste
- Owner: k37y
- License: mit
- Created: 2022-10-14T15:51:33.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-14T16:15:11.000Z (about 2 years ago)
- Last Synced: 2024-12-04T16:46:52.573Z (about 1 month ago)
- Topics: curl, golang, paste
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang powered cURL paste
The `HTTP` `POST` request will send the form data along and respond with a link to the paste. The `HTTP` `GET` will retrieve the paste with the given ID as plain-text.
### Usage
Paste a file named `file.txt` using cURL.
```bash
$ curl -F 'title=Request from cURL' -F 'paste=<file.txt' http://curl-paste.local/
```
Paste from stdin using cURL.
```bash
echo "Hello, world." | curl -F 'title=Request from cURL' -F 'paste=<-' http://curl-paste.local/
```
A shell function that can be added to `.bashrc` or `.bash_profle` for quick pasting from the CLI. The command reads from stdin and outputs the URL of the paste to stdout.
```bash
function curl-paste() {
curl -F 'title=Request from cURL' -F 'paste=<-' https://curl-paste.local
}
```
```bash
echo "hi" | curl-paste
```