Spaces:
Sleeping
Sleeping
| import httpx | |
| base_url = 'https://lex.lab.i.ai.gov.uk' | |
| url = f'{base_url}/amendment/search' | |
| payload = { | |
| 'legislation_id': 'ukpga/1983/20' | |
| } | |
| print(f"POSTing to {url} with {payload}") | |
| r = httpx.post(url, json=payload, timeout=10) | |
| print('Status:', r.status_code) | |
| d = r.json() | |
| if isinstance(d, list) and d: | |
| print(f'Found {len(d)} amendments.') | |
| for a in d[:3]: | |
| acting_law = a.get("amended_by_legislation_title", "Unknown") | |
| target_prov = a.get("amended_provision_id", "Unknown") | |
| amend_type = a.get("amendment_type", "Unknown") | |
| print(f'-> {target_prov} amended by: {acting_law} (Type: {amend_type})') | |
| else: | |
| print('Raw:', d) | |