mirror of
https://github.com/samsonjs/mit-license.git
synced 2026-03-25 09:25:49 +00:00
Update API usage
This commit is contained in:
parent
0b0afb9a83
commit
fed21bbef0
1 changed files with 12 additions and 0 deletions
12
README.md
12
README.md
|
|
@ -25,6 +25,18 @@ You can send a full JSON file to the API, not _just_ the copyright, so this work
|
|||
curl -d'{ "copyright": "Remy Sharp", "url": "http://remysharp.com", "email": "me@mysite.com", "format": "txt" }' https://rem.mit-license.org
|
||||
```
|
||||
|
||||
Whilst the command above sends the data as a string which will later be parsed, you can explicitly specify a JSON `Content-Type`:
|
||||
|
||||
```bash
|
||||
curl -H 'Content-Type: application/json' -d'{ "copyright": "Remy Sharp", "url": "http://remysharp.com", "email": "me@mysite.com", "format": "txt" }' https://rem.mit-license.org
|
||||
```
|
||||
|
||||
You can also encode the data as URL query parameters like so:
|
||||
|
||||
```bash
|
||||
curl -X POST "https://rem.mit-license.org/?copyright=Remy%20Sharp&url=http%3A%2F%2Fremysharp.com&email=me%40mysite.com&format=txt"
|
||||
```
|
||||
|
||||
If there's any problems in the automated creation, send me a pull request and it'll go live soon after.
|
||||
|
||||
Equally if you need to update the user file to include more details that you didn't initially include (extra fields in the next section) you will need to send a pull request on that `user.json` file via GitHub.
|
||||
|
|
|
|||
Loading…
Reference in a new issue