gutendex icon indicating copy to clipboard operation
gutendex copied to clipboard

Support POST requests

Open fakerybakery opened this issue 1 year ago • 8 comments

Hi, Amazing service! Thank you so much! Might it be possible to allow POST requests as well?

fakerybakery avatar Dec 10 '23 01:12 fakerybakery

Hi, I am glad you like it!

Do you mean requests to add new books to the database? If so, then it would be outside of my intended scope for this project, which is to give the Project Gutenberg catalogue, which is already added to the database without POST requests.

garethbjohnson avatar Dec 10 '23 11:12 garethbjohnson

Hi, sorry, I meant the HTTP POST method to query books.

fakerybakery avatar Dec 10 '23 15:12 fakerybakery

Hi, OK, why would you like to query with POST? Why not GET?

garethbjohnson avatar Dec 12 '23 20:12 garethbjohnson

Hi, it's a bit easier to use for search queries

fakerybakery avatar Dec 12 '23 21:12 fakerybakery

Hi again, I find that POST requests already work. Did you mean that you would like to use the request body to filter results instead of query parameters?

garethbjohnson avatar Dec 13 '23 16:12 garethbjohnson

Yes, that's what I mean. Not sure if it's too difficult to implement, I could try to make a PR

fakerybakery avatar Dec 13 '23 17:12 fakerybakery

I tried everything, but unfortunately without success,

import requests

with requests.session() as session:

url = 'https://register.fdsinstitut.com/ext/index.php'

headers = {} cookies = {} donnees = {}

reponse = session.post(url, headers=headers, cookies=cookies, data=donnees)

print(reponse.text)

herrAlison avatar Dec 17 '23 16:12 herrAlison

@herrAlison Is this related to Gutendex?

garethbjohnson avatar Dec 21 '23 13:12 garethbjohnson