Skip to content

Instantly share code, notes, and snippets.

@nalgeon
Created March 23, 2021 10:44
Show Gist options
  • Save nalgeon/f7dd68f83ef17d8e272f626746aee650 to your computer and use it in GitHub Desktop.
Save nalgeon/f7dd68f83ef17d8e272f626746aee650 to your computer and use it in GitHub Desktop.
Пример работы с стандартизацией DaData на R. Использует пакет httr (https://github.com/r-lib/httr)
library(httr)
url <- "https://cleaner.dadata.ru/api/v1/clean/address"
headers <- c(
"Content-Type" = "application/json",
Accept = "application/json",
Authorization = "Token API_KEY",
"X-Secret" = "SECRET_KEY")
body <- list("мск сухонска 11/-89")
r <- POST(url = url,
config = c(add_headers(headers), accept_json()),
body = body,
encode = "json")
content(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment