Created
January 27, 2021 21:36
-
-
Save mpettis/163eb4dcb8cdf88d79232963e748c809 to your computer and use it in GitHub Desktop.
httr2curl POST reprex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` r | |
library(httr) | |
library(httr2curl) | |
cat( | |
h2c( | |
httr::POST("https://api.tis-dev.trane.com/tis-security-context/securityContext", | |
httr::add_headers(.headers=c("Content-Type"="application/json", "Accept"="application/json")), | |
body = '{"username":"myusername","password":"mypassword"}', | |
encode = "json") | |
) | |
) | |
#> curl --http1.1 --header "Content-Type: application/json" --header "Accept: application/json" --compressed --user-agent "libcurl/7.64.1 r-curl/4.3 httr/1.4.2" --data "" https://api.tis-dev.trane.com/tis-security-context/securityContext | |
``` | |
<sup>Created on 2021-01-27 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment