Add a restful api. in the go code do something operate

i want to develop a datasouce ,its need to update a file,i want to add a restful api in the go code…use $http to post some data to the go funciton to do some operate, but there always occur this questions

Is this a datasource plugin?

It looks like you are trying to post to the http api endpoint that saves datasource config data (name, url etc.). That is probably not what you want to do.

yes.this is a datasource plugins, i want to upload a file,and read the file content,transform it to json,and write json to a file.put it in the grafana dir, when the panel use the datasource ,.i want to read the json file as datasource

api is working ,but has another questions.

, post data has data,but the cmd could not get data

how could i read the upload file

this is post data .but go cant get the file data

@daniellee i had resolved this problem.thx

1 Like