Skip to content

Instantly share code, notes, and snippets.

@white5168
Last active January 5, 2017 16:58
Show Gist options
  • Save white5168/2a85433bb762a92a2d9f6967cb9b4ced to your computer and use it in GitHub Desktop.
Save white5168/2a85433bb762a92a2d9f6967cb9b4ced to your computer and use it in GitHub Desktop.
library(httr);
picurl <- "http://www.ccf.org.tw/new/endpoverty/images/product/product-pic1.jpg"
url <- "https://notify-api.line.me/api/notify"
message <- "中文測試~!@#$%^&*()123456789"
token <-"Bearer 你的Token"
postdata <- list("message"=message,
"imageThumbnail"=picurl,
"imageFullsize"=picurl,
"stickerPackageId"="1",
"StickerId"="106")
header <- add_headers("Authorization"=token)
req <- POST(url, header, body = postdata, encode="form")
status <- content(req , as ="text", encoding="utf-8")
status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment