I have deployed a model to AI Platform Predictions successfully by following this tutorial. Now, I want to make predictions with this model via HTTP requests.
As suggested by @Ismail, I followed Method: projects.predict documentation.
I'm sending a POST request to https://ml.googleapis.com/v1/projects/${PROJECT_ID}/models/${MODEL_NAME}:predict with the following body:
{
"instances": [
[51.0, 17.0, 6.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0]
]
}
The numbers are the model's input.
I receive the following response:
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
I sent the POST request using the RestMan chrome extension. I would like to be able to get a prediction with RestMan.
My question is: how can I authenticate my HTTP POST request? Should I send some information in the request's header?