little-brother / sqlite-gui

Lightweight SQLite editor for Windows
GNU General Public License v2.0
1.07k stars 51 forks source link

REST API with curl #134

Closed abeq closed 1 year ago

abeq commented 1 year ago

Hi, I have tried REST API but error has occurred:

C:\Users\foobar> curl http://127.0.0.1/api/books -X GET
curl: (1) Unsupported HTTP version in response

Please advise me.

little-brother commented 1 year ago

You forgot to specify a port. Your request uses default 80 but sqlite-gui waits on 3000.

abeq commented 1 year ago

I thought you are right, but I have tried curl http://127.0.0.1:3000/api/books -X GET then return same error. With Chrome, I got expected return.

abeq commented 1 year ago

withdrawn

little-brother commented 1 year ago

Why? The issue exists. I don't the cause yet. Perhaps some response headers are missing. Sorry, I don't have a time to investifate and fix it immediately.

little-brother commented 1 year ago

It was a bug. I forgot to set a response status. Fixed.