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