Comments (3)
Hi, I'll look into this when I can. The API was rather thrown together to be quite honest - I will probably redo the majority of it as soon as I get a break from other projects. Hang tight for now and I'll investiage what the issue is (I have only used curl to test the API so it is likely that it breaks for non-curl clients).
from liteshort.
Actually, I see what's going on here. You have to specify format=json
along with api=listshort
. This is addressed by issue #4. This is very stupid and will definitely be removed when I rework the API.
from liteshort.
I'm still not sure exactly how it should be formatted. I tried:
curl --request POST \
--url https://smol.gq/ \
--header 'authorization: Basic a2V2aW46bmVvcnU=' \
--header 'content-type: application/json' \
--data '{
"api": "listshort",
"format": "json"
}'
As well as:
curl --request POST \
--url https://smol.gq/ \
--header 'authorization: Basic a2V2aW46bmVvcnU=' \
--header 'format: json' \
--header 'api: listshort'
But, both still return the HTTP.
Edit: Ah. The REST client wasn't giving me the correct curl
format. It works after using the format curl -u 'user:pass' -d 'api=listshort' -d 'format=json' [url]
.
from liteshort.
Related Issues (13)
- Docker image HOT 7
- Use Accept instead of POST data to decide when to use JSON
- Add option to disallow self-links HOT 1
- Question : maximum combinations of short links HOT 1
- API delete returns success but does not actually delete the URL HOT 2
- Add option to allow extensions without fully allowing period character HOT 1
- Add option to disable link to latest URL generated HOT 1
- Add requirements.txt
- Debian and PyPi Packages HOT 3
- Add optional link expiration HOT 1
- Logging location HOT 9
- Adding a Dockerfile HOT 3
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 liteshort.