I am using SwaggerHub for API documentation for my web application. When I use the bearer token for authentication, and I run a get request that is supposed to return a JSON of the user's trip information. It returns a 200 HTTP response, but the body response does not return the JSON information, instead it returns HTML text. The image below shows the result. Why is this happening?

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I am using SwaggerHub for API documentation for my web application. When I use the bearer token for authentication, and I run a get request that is supposed to return a JSON of the user's trip information. It returns a 200 HTTP response, but the body response does not return the JSON information, instead it returns HTML text. The image below shows the result. Why is this happening?

200
Response body
<!doctype html><html lang="en"><head><meta charset
="utf-8"/> <link rel="icon" href="/favicon.ico"/><me
ta name="viewport" content="width=device-width, init
ial-scale=1"/><meta name="theme-color" content="#00
0000"/> <meta name="description" content="Web site c
reated using create-react-app"/><link rel="apple-to
uch-icon" href="/logo192.png"/><link
rel="manifest"
href="/manifest.json"/><title>React App</title><scr
ipt defer="defer" src="/static/js/main.834b06af.j
s"></script><link href="/static/css/main.073c9b0a.c
ss" rel="stylesheet"></head><body><noscript>You nee
d to enable JavaScript to run thi
div id="root"></div></body></htm]
Response headers
accept-ranges: bytes
alt-svc: h3=":443" ;ma=86400,h3-
29=":443";ma=86400,h3-27=":443";ma=86400
cache-control: no-cache
content-encoding: br
content-length: 246
content-type: text/html; charset=utf-8
date: Fri, 27 Jan 2023 21:52:16 GMT
etag:
Download
"681f9eeebc55900f3268e17eb7850a14ebb7f129de632fdda
6661921f5245e69-br"
expires: -1
last-modified: Fri, 13 Jan 2023 20:29:21 GMT
status: 304 Not Modified
vary: x-fh-requested-host, accept-encoding
x-cache: HIT
-b- ba
3
Transcribed Image Text:200 Response body <!doctype html><html lang="en"><head><meta charset ="utf-8"/> <link rel="icon" href="/favicon.ico"/><me ta name="viewport" content="width=device-width, init ial-scale=1"/><meta name="theme-color" content="#00 0000"/> <meta name="description" content="Web site c reated using create-react-app"/><link rel="apple-to uch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><scr ipt defer="defer" src="/static/js/main.834b06af.j s"></script><link href="/static/css/main.073c9b0a.c ss" rel="stylesheet"></head><body><noscript>You nee d to enable JavaScript to run thi div id="root"></div></body></htm] Response headers accept-ranges: bytes alt-svc: h3=":443" ;ma=86400,h3- 29=":443";ma=86400,h3-27=":443";ma=86400 cache-control: no-cache content-encoding: br content-length: 246 content-type: text/html; charset=utf-8 date: Fri, 27 Jan 2023 21:52:16 GMT etag: Download "681f9eeebc55900f3268e17eb7850a14ebb7f129de632fdda 6661921f5245e69-br" expires: -1 last-modified: Fri, 13 Jan 2023 20:29:21 GMT status: 304 Not Modified vary: x-fh-requested-host, accept-encoding x-cache: HIT -b- ba 3
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage