Closed kush99993s closed 7 years ago
Hi. This is working for me. The proper name is all-caps with hyphens substituted for underscores like you have in your second example.
#* @get /
healthCheck <- function(){
print("It's Running")
}
#* @param id:int Random Number
#* @post /test/values
#* @get /test/values
test <- function(id, req, res){
print(ls(req))
print(req[["HTTP_X_NAME"]])
return(req[["HTTP_X_NAME"]])
}
Then I can run
$ curl --header "X-Name: hithere" http://localhost:9824/test/values
["hithere"]
Thanks, it is working for me 👍
I am trying to pass header "X-Name" from postman then access it from API which is build using Plumber R.
However, I am not able to access it. using following code,
req$HTTP_X-NAME
, then i am getting following error.If I use following code, I get NULL values,
or
or
Following is my code: