Skip to content

Instantly share code, notes, and snippets.

@brettrowberry
Created June 10, 2019 13:09
Show Gist options
  • Save brettrowberry/bd9cf26fce1c6bf556e46ce13a48cd3e to your computer and use it in GitHub Desktop.
Save brettrowberry/bd9cf26fce1c6bf556e46ce13a48cd3e to your computer and use it in GitHub Desktop.
Shows calling a URL passing a bearer token. Like a poor person's Postman using F# Interactive.
open System.Net
let url = "http://someendpoint"
let token = "some token"
let wc = new WebClient()
let whc = WebHeaderCollection()
whc.Set("Authorization", "Bearer " + token)
wc.Headers <- whc
wc.DownloadString url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment