url="{{ request.build_absolute_uri }}"# GET Request
curl -X GET "$url"# POST Request
curl -X POST "$url" \
-H "Content-Type: application/json" \
-d '{...}'# PUT Request
curl -X PUT "$url" \
-H "Content-Type: application/json" \
-d '{...}'# PATCH Request
curl -X PATCH "$url" \
-H "Content-Type: application/json" \
-d '{...}'# DELETE Request
curl -X DELETE "$url"
import requests
url = "{{ request.build_absolute_uri }}"# GET Request
response = requests.get(url)# POST Request
response = requests.post(url, json={...})# PUT Request
response = requests.put(url, json={...})
# PATCH Request
response = requests.patch(url, json={...})
# DELETE Request
response = requests.delete(url)
# Handle response
print(response.status_code)
const url = '{{ request.build_absolute_uri }}'// GET Request
let response = fetch(url)// POST Request
let response = fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({...}),
})// PUT Request
let response = fetch(url, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({...}),
})// PATCH Request
let response = fetch(url, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({...}),
})// DELETE Request
let response = fetch(url, { method: 'DELETE' })// Handle response
response.then(r => console.log(r.ok))