|
|
|
|
|
by davidism
4130 days ago
|
|
> A GET query is always a URI. Anyone can link to it. Except this isn't really useful outside of bookmarks in a browser. Who would bookmark an API endpoint returning JSON? In code, it's just as easy to make a request with query parameters as it is with a post body. #!/usr/bin/env python
import requests
requests.get('http://example.com/', params={'key': 'value'})
requests.post('http://example.com/', data={'key': 'value'})
|
|
If you use "Accept:application/json", then you should expect to get JSON back. Etc.