I'm planning an API for my own use, in Python. Perhaps someday I will make it freely accessible, but now I'm only planning to use it on my hobby site. At this stage I need some advice on how to set up the URLs, for files that receive both GET and POST requests.
Suppose one of my files is called function_A.py
and used in this fashion:
www.example.com/api/function_A.py?a=something&k=other+thing
My question is, how does one set up 'pretty' URLs in an API, in the least resource-intensive way?
I see most APIs have a typical URL format like http://www.example.com/api/read
instead of http://www.example.com/api/read.py
My options are probably limited to mod_rewrite
v/s urls.py
using Django - or is there another simpler option?
This is for the backend/API and I'd rather keep overhead to a minimum. I only want to handle 4 URLs in this fashion, and do not want to have a regex occur every time the URL is called.