I'm using google cloud's "Hello World" demo for cloud functions but the URL it produces gives me an error:
Error: Page not found
The requested URL was not found on this server.
I follow the tutorial, check allow unauthenticated, etc yet the url trigger leads me to the error.
The curl response requested also returns an error:
curl -X POST MY_URL -H "Content-Type:application/json" -d '{"name":"Jane"}'
returns:
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>404 Page not found</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Page not found</h1>
<h2>The requested URL was not found on this server.</h2>
<h2></h2>
</body></html>
Any ideas why?
Edit2: the url in MY_URL is structured like this:
curl -X POST https://us-west1-PROJECT-NAME.cloudfunctions.net/FUNCTION-NAME -H "Content-Type:application/json" -d '{"message":"Jane"}'
curl
the endpoint. If you click the "TRIGGER" tab, it will present you with the URL. Or you can usegcloud functions describe ${FUNCTION} --project=${PROJECT} --format="value(httpsTrigger.url)"
– Mayne{"message": "test"}
to the service but yourcurl
using{"name":"jane"}
. You want to use{"message": "test"}
(since you know this works). But that's another issue. – Mayne