Class BlockRequest
A block that can perform HTTP requests.
Implements
Inherited Members
Namespace: RuriLib
Assembly: RuriLib.dll
Syntax
public class BlockRequest : BlockBase, INotifyPropertyChanged
Constructors
| Improve this Doc View SourceBlockRequest()
Creates a Request block.
Declaration
public BlockRequest()
Properties
| Improve this Doc View SourceAuthPass
The password for basic auth requests.
Declaration
public string AuthPass { get; set; }
Property Value
Type | Description |
---|---|
System.String |
AuthUser
The username for basic auth requests.
Declaration
public string AuthUser { get; set; }
Property Value
Type | Description |
---|---|
System.String |
AutoRedirect
Whether to perform automatic redirection in the case of 3xx headers.
Declaration
public bool AutoRedirect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ContentType
The type of content the server should expect.
Declaration
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CustomCookies
The custom cookies that are sent in the HTTP request.
Declaration
public Dictionary<string, string> CustomCookies { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> |
CustomHeaders
The custom headers that are sent in the HTTP request.
Declaration
public Dictionary<string, string> CustomHeaders { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.String> |
DownloadPath
The path of the file where a FILE response needs to be stored.
Declaration
public string DownloadPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Method
The method of the HTTP request.
Declaration
public HttpMethod Method { get; set; }
Property Value
Type | Description |
---|---|
Extreme.Net.HttpMethod |
MultipartBoundary
The boundary that separates multipart contents.
Declaration
public string MultipartBoundary { get; set; }
Property Value
Type | Description |
---|---|
System.String |
MultipartContents
The list of contents to send in a multipart request.
Declaration
public List<MultipartContent> MultipartContents { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<MultipartContent> |
PostData
The content of the request, sent after the headers. Use '\n' to input a linebreak.
Declaration
public string PostData { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ReadResponseSource
Whether to read the stream of data from the HTTP response. Set to false if only the headers are needed, in order to speed up the process.
Declaration
public bool ReadResponseSource { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RequestType
The request type.
Declaration
public RequestType RequestType { get; set; }
Property Value
Type | Description |
---|---|
RequestType |
ResponseType
The type of response expected from the server.
Declaration
public ResponseType ResponseType { get; set; }
Property Value
Type | Description |
---|---|
ResponseType |
Url
The URL to call, including additional GET query parameters.
Declaration
public string Url { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceFromLS(String)
Builds a block from a line of LoliScript code.
Declaration
public override BlockBase FromLS(string line)
Parameters
Type | Name | Description |
---|---|---|
System.String | line | The line of LoliScript code |
Returns
Type | Description |
---|---|
BlockBase | The parsed block object |
Overrides
| Improve this Doc View SourceGetCustomCookies()
Builds a string containing custom cookies.
Declaration
public string GetCustomCookies()
Returns
Type | Description |
---|---|
System.String | One cookie per line, with name and value separated by a colon |
GetCustomHeaders()
Builds a string containing custom headers.
Declaration
public string GetCustomHeaders()
Returns
Type | Description |
---|---|
System.String | One header per line, with name and value separated by a colon |
GetMultipartContents()
Builds a string containing multipart content.
Declaration
public string GetMultipartContents()
Returns
Type | Description |
---|---|
System.String | One content per line, with type, name and value separated by a colon |
ParsePair(String)
Parses a pair of values separated by a colon.
Declaration
public static KeyValuePair<string, string> ParsePair(string pair)
Parameters
Type | Name | Description |
---|---|---|
System.String | pair | The string containing colon-separated values |
Returns
Type | Description |
---|---|
System.Collections.Generic.KeyValuePair<System.String, System.String> | The pair of values. |
Process(BotData)
Executes the actual block logic.
Declaration
public override void Process(BotData data)
Parameters
Type | Name | Description |
---|---|---|
BotData | data | The BotData needed for variable replacement |
Overrides
| Improve this Doc View SourceSetCustomCookies(String[])
Sets custom cookies from an array of lines.
Declaration
public void SetCustomCookies(string[] lines)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | lines | The lines containing the colon-separated name and value of the cookies |
SetCustomHeaders(String[])
Sets custom headers from an array of lines.
Declaration
public void SetCustomHeaders(string[] lines)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | lines | The lines containing the colon-separated name and value of the headers |
SetMultipartContents(String[])
Sets multipart contents from an array of lines.
Declaration
public void SetMultipartContents(string[] lines)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | lines | The lines containing the colon-separated type, name and value of the multipart contents |
ToLS(Boolean)
Converts the block to LoliScript code.
Declaration
public override string ToLS(bool indent = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | indent |
Returns
Type | Description |
---|---|
System.String |