ryantxu / ajax-panel

Ajax Panel Plugin for Grafana
MIT License
153 stars 154 forks source link

GET method does not show the result #77

Open debasishdas033 opened 3 years ago

debasishdas033 commented 3 years ago

package main

import ( “fmt” “net/http” “github.com/gorilla/mux” ) func showRecord(w http.ResponseWriter, r *http.Request) { out :=“Hello World” w.Header().Set(“Content-Type”, “text/plain”) fmt.Fprintf(w,out)

} func handleRequests() { router :=mux.NewRouter() router.HandleFunc("/dashboard/show",showRecord).Methods(“GET”) http.ListenAndServe(":8080", router) }

func main() { handleRequests() }

In ryantx-ajax-panel I am able to get the output using iframe. But when using GET method in the panel getting the below error

Request Error {“data”:{“message”:“Unexpected error”}}

Please guide how to get the output using GET method instead of iframe.

Thanks, Debasish

florian-guillemard commented 2 years ago

Hi,

Same problem here.. We are trying to get JSON and we get it just with iframe output !

Any solution @debasishdas033 ?