14 [BadMethod(description:
"Encodes a URI Component")]
15 [
return: BadReturn(
"The encoded URI Component")]
16 private string EncodeUriComponent([BadParameter(description:
"The component to encode")] string s)
18 return Uri.EscapeDataString(s);
21 [BadMethod(description:
"Decodes a URI Component")]
22 [return: BadReturn(
"The decoded URI Component")]
23 private string
DecodeUriComponent([BadParameter(description:
"The component to decode")] string s)
25 return Uri.UnescapeDataString(s);
35 [BadMethod(description:
"Performs a POST request to the given url with the given content")]
36 [return: BadReturn(
"The Awaitable Task")]
38 [BadParameter(description:
"The URL of the POST request")]
40 [BadParameter(description:
"The String content of the post request")]
43 HttpClient cl =
new HttpClient();
47 $
"Net.Post(\"{url}\")"
56 [BadMethod(description:
"Performs a GET request to the given url")]
57 [return: BadReturn(
"The Awaitable Task")]
58 private static
BadTask Get([BadParameter(description:
"The URL of the GET request")] string url)
60 HttpClient cl =
new HttpClient();
61 Task<HttpResponseMessage>? task = cl.GetAsync(url);
Implements a Task Object.
static BadInteropRunnable WaitForTask(System.Threading.Tasks.Task t)
Implements the "Net" Api.
static BadTask Post([BadParameter(description:"The URL of the POST request")] string url, [BadParameter(description:"The String content of the post request")] string content)
Creates a new BadTask that performs a POST request to the given url with the given content.
static BadTask Get([BadParameter(description:"The URL of the GET request")] string url)
Creates a new BadTask that performs a GET request to the given url.
string DecodeUriComponent([BadParameter(description:"The component to decode")] string s)
string EncodeUriComponent([BadParameter(description:"The component to encode")] string s)
Contains task/async Extensions and Integrations for the BadScript2 Runtime.
Contains Networking Extensions and APIs for the BadScript2 Runtime.