Postman request to Google Cloud Shell Editor Preview returns HTML

81 Views Asked by At

I am writing a golang webserver with the Google Cloud Shell Editor and attempting to test it via postman by making requests against the URL generated when I create the web preview of my code running on port 8080. However instead of receiving a JSON response as expected I am receiving this HTML page.

Request: POST https://8080-cs-277337641258-default.cs-us-east1-rtep.cloudshell.dev/api/userToken

Response:

<!doctype html>
<html lang="en-US" dir="ltr">

<head>
    <base href="https://accounts.google.com/v3/signin/">
    <meta name="referrer" content="origin">
    <meta name="viewport" content="width=device-width, initial-scale=1">
.
. (response too long to copy here)
.
</script>
</div>
</div>
</body>

I have successfully been able to generate my own authorization token referencing various stackoverflow posts and other websites such as:

API Credentials Client ID for Web application

Postman Authorization Token Configuration

Token Created in Postman

However despite this it looks like I'm still being prompted to authenticate my API request via the browser judging by the HTML response returned. Am I missing something or is a request like this via Postman to the Google Cloud Shell just not possible?

0

There are 0 best solutions below