Police-Data-Accessibility-Project / docs

Documentation for the Police Data Accessibility Project.
https://docs.pdap.io
3 stars 6 forks source link

Update docs to include examples of request #17

Open maxachis opened 1 month ago

maxachis commented 1 month ago

Docs can be made more accessible by including examples (in some programming or shell language) showing the requests in action. This will help make things easier for individuals in general but especially those new to making endpoint requests. Additionally, it will help make clear to both developers and users what the intended functionality is, making it easier to zero in on deviations. For example, we could provide:

import requests
import json

response = requests.post(
    "https://www.example.com/submit-form",
    data=json.dumps({"name": "John Doe", "age": 25}),
    headers={"Content-Type": "application/json"}
)

As an example for a submit-form endpoint.