This repository has been archived by the owner on May 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
499ef3b
commit fb91e9d
Showing
7 changed files
with
101 additions
and
78 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Net; | ||
using System.IO; | ||
using System.Text; | ||
|
||
namespace DotCEP | ||
{ | ||
internal static class ControleRequisicoes | ||
{ | ||
internal static string ObterStringJSONS(string url) | ||
{ | ||
try | ||
{ | ||
HttpWebRequest request = | ||
(HttpWebRequest)WebRequest.Create(url); | ||
|
||
WebResponse response = request.GetResponse(); | ||
|
||
using (Stream stream = response.GetResponseStream()) | ||
{ | ||
StreamReader reader = new StreamReader(stream, Encoding.UTF8); | ||
return reader.ReadToEnd(); | ||
} | ||
} | ||
catch (System.Exception ex) | ||
{ | ||
throw new System.Exception(string.Format("Erro ao tentar fazer a requisição: {0}", ex.Message)); | ||
} | ||
} | ||
} | ||
} | ||
|
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
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
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