Hi Community.
So, i have been trying to request from my Go service using Ajax/fetch with the kibana plugin Js file but so far no luck. I get a 405 (method not allowed)
error.
request:
fetch('https://somelink/createinfo', { mode: 'no-cors'}, { headers: { 'Content-Type': 'application/json' }, method: "POST", body: jsonsjson }) .then(res => res.text()) .then(console.log)
On Go service I have added the following header.
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Max-Age", "3600")
w.Header().Set("Access-Control-Allow-Credentials", "true")
w.Header().Set("Access-Control-Allow-Headers", "Access-Control-Allow-Headers, Access-Control-Allow-Methods, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers")
w.Header().Set("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT,DELETE")
The service responds just fine on POSTMAN with no additional headers. Also, the setup is present on k8s and I am using ingress to expose the service securely.
Any help here wil be great. thanks!