It sems the server returns no data, the status_code is 200 but when trying to extract the json from “https://2eraiuh.dlai.link/api/business_info”, I get this error stack:
File /opt/conda/lib/python3.11/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
354 except StopIteration as err:
→ 355 raise JSONDecodeError(“Expecting value”, s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 2 column 1 (char 1)
I already restarted the server and re-created the notebook
I also printed the API _KEY and it seems fine
Same problem here. I tried adding headers = {‘Accept’: ‘application/json’} in case that might force json to be returned.
I am getting an HTML file instead of JSON returned … here are the first 1000 chars or response.text
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NYC Restaurant Inspections</title>
<style>
/* Style for the body */
body {
padding: 20px;
font-family: Arial, sans-serif;
text-align: center;
}
/* Style for the table container */
.table-container {
max-width: 100%;
overflow-x: auto;
}
/* Style for the table */
.table {
width: 100%;
margin-bottom: 1rem;
margin-top: 1rem;
color: #212529;
border-collapse: collapse;
}
/* Style for the table headers */
.table th{ /*dont add the border-top here*/
padding: 0.75rem;
vertical-align: center;
background-color: #c6e2ff6c;
},
/* Style for the table cells */
.table td {
Hi! This is working fine on my end. Can you send me your code for Exercise 2 via DM so we can investigate and add more hints if necessary? You can click my name then the blue Message button. Thanks.
For other learners who might encounter this issue, please check the variable you’re using when sending the request. You might be using the one in the earlier exercise and that will yield an error.