Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R、 Json,restapi_R_Json_Rest_Post - Fatal编程技术网

R、 Json,restapi

R、 Json,restapi,r,json,rest,post,R,Json,Rest,Post,我试图使用RESTAPI service POST方法从数据库中的报告中提取数据,该方法可从R脚本获得,如下所示 #Loading Libraries library(RJSONIO) library(RCurl) library(httr) library(jsonlite) r <- POST(url, body = '{ "id":104106,

我试图使用RESTAPI service POST方法从数据库中的报告中提取数据,该方法可从R脚本获得,如下所示

#Loading Libraries
library(RJSONIO)
library(RCurl)
library(httr)
library(jsonlite)

r <- POST(url, 
          body = '{  
          "id":104106,                                                                         
          "lookupName": "Task Report",
          "filters": [ 
          {
          "name":"Created Time",
          "values": ["2018-05-06T00:00:00+0530","2018-05-06T23:59:59+0530"]
          }
          ]}' ,
          add_headers("ApplicationName : APP_1")
)

stop_for_status(r)
a<-content(r, "text", "application/json", encoding="UTF-8")

df = fromJSON(a, flatten = TRUE)
df$links = NULL
df$count = NULL
df$name = NULL
df$columnNames = NULL
main_df = as.data.frame(df)
#加载库
图书馆(RJSONIO)
图书馆(RCurl)
图书馆(httr)
图书馆(jsonlite)

有任何请求限制吗?你能详细说明请求限制的含义吗?比如每小时1k请求。我没有收到你的评论。在运行R脚本时,我希望获得给定日期范围的所有数据。因为我不知道您使用的api的结构,所以我不确定您是否可以在一次调用中完成。如果你能缩小你给定的日期范围,你可以得到少于10公里的结果。把你的约会范围分成几块。类似于0-4H4-8H8-12H12-16H16-20H20-24Hconcat,将结果放入一个数据帧中。