I am new on AWS. I was trying to do an http post to an aws lambda function and received an error 403(Forbidden). I understood I had to pass AWS_SECRET and AWS_Key with post. How do I do it? My coding language for post is golang.
Code in Context
url := "https://xxxxx.xxxxx-api.us-west-x.amazonaws.com/prod/xxxxxx"
var jsonStr = []byte(`{"title":"Some data"}`)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
req.Header.Set("X-Custom-Header", "myvalue")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("response Status:", resp.Status) // response message
Respose Message
response Status: 403 Forbidden
How should I pass the authentication parameters? Is it to be passed along with the url?