raannakasturi commited on
Commit
25bc226
·
1 Parent(s): cdfcec2

Unescape HTML content in JSON response for read_item function

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import fastapi
2
  import uvicorn
3
  import requests
 
4
  from fastapi.responses import JSONResponse
5
  from fastapi.exceptions import HTTPException
6
 
@@ -38,4 +39,7 @@ def read_item(url: str):
38
  if not url:
39
  raise HTTPException(status_code=400, detail="Missing 'url' query parameter")
40
  data = fetch_feed(url)
41
- return JSONResponse(content=data)
 
 
 
 
1
  import fastapi
2
  import uvicorn
3
  import requests
4
+ import html
5
  from fastapi.responses import JSONResponse
6
  from fastapi.exceptions import HTTPException
7
 
 
39
  if not url:
40
  raise HTTPException(status_code=400, detail="Missing 'url' query parameter")
41
  data = fetch_feed(url)
42
+ return JSONResponse(content=html.unescape(data))
43
+
44
+ # if __name__ == "__main__":
45
+ # uvicorn.run(app)