Hi Kaniz,
I was able to find the solution. You should post this in the examples when you click "Query Endpoint"
You only have code for Browser, Curl, Python, SQL. You should add a tab for R
Here is the solution:
library(httr)
url <- "https://adb-********.azuredatabricks.net/serving-endpoints/********/invocations"
db_token="dap*******"
headers <- add_headers('Authorization'==paste('Bearer', db_token, sep=' '),
"Content-Type" = "application/json")
data='{"dataframe_split": {"columns": ["***columnName1String***", "***ColumnName2Integer****"], "data": [["val11", val12], ["val21", val22], ["val31", val32]]}}'
response= POST(url,headers,body=data)
results <- content(response, "parsed")