-
-
Save dan0nchik/cb940732602b852a65984b3c887b9cce to your computer and use it in GitHub Desktop.
Get request in ASP.NET core
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
WebRequest request = WebRequest.Create("https://api.thecatapi.com/v1/categories"); | |
using (var s = request.GetResponse().GetResponseStream()) | |
{ | |
using (var sr = new StreamReader(s)) | |
{ | |
var asJSON = sr.ReadToEnd(); | |
res = JsonConvert.DeserializeObject<List<CategoriesModel>>(asJSON); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment