LoginSignup
1
0

More than 1 year has passed since last update.

R の http クライアントの使い方 (Get)

Last updated at Posted at 2018-03-07

次のページを参考にしました。
httr quickstart guide

パッケージのインストール

> install.packages("httr")

Ubuntu でのインストール

sudo apt install r-cran-httr

プログラム

http_get.R
# ---------------------------------------------------------
#	http_get.R
#
#				Mar/07/2018
#
# ---------------------------------------------------------
write("*** 開始 ***", stderr())
library (httr)
rr <- GET("https://httpbin.org/get")
print ("---------------------")
http_status(rr)
print ("---------------------")
str(content(rr))
print ("---------------------")
rr
write("*** 終了 ***", stderr())
# ---------------------------------------------------------

実行コマンド

Rscript --no-restore --no-save http_get.R

次のバージョンで確認しました。

$ Rscript --version
Rscript (R) version 4.2.1 (2022-06-23)
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0