Created
August 17, 2016 19:00
-
-
Save patriksvensson/e2ddbd75ae2fa7a5ec5602b6a6b4a57c to your computer and use it in GitHub Desktop.
Cake script: Gets the status code from a web request and outputs it.
This file contains hidden or 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
// Cake script | |
#r "System.Net" | |
using System.Net; | |
var request = (HttpWebRequest)WebRequest.Create("http://google.com"); | |
var response = (HttpWebResponse)request.GetResponse(); | |
var statusCode = response.StatusCode; | |
Information("Received {0}!", statusCode); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment