using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; namespace Proyecto26 { public partial class RequestHelper { private string _uri; /// /// Defines the target URL for the UnityWebRequest to communicate with /// public string Uri { get { return _uri; } set { _uri = value; } } private string _method; /// /// Defines the HTTP verb used by this UnityWebRequest, such as GET or POST. /// public string Method { get { return _method; } set { _method = value; } } private object _body; /// /// The data to send to the server, encoding the body with JsonUtility /// public object Body { get { return _body; } set { _body = value; } } private string _bodyString; /// /// The data serialized as string to send to the web server (Using other tools instead of JsonUtility) /// public string BodyString { get { return _bodyString; } set { _bodyString = value; } } private byte[] _bodyRaw; /// /// The data as byte array to send to the server /// public byte[] BodyRaw { get { return _bodyRaw; } set { _bodyRaw = value; } } private int? _timeout; /// /// Sets UnityWebRequest to attempt to abort after the number of seconds in timeout have passed. /// public int? Timeout { get { return _timeout; } set { _timeout = value; } } private string _contentType; /// /// Override the content type of the request manually /// public string ContentType { get { return _contentType; } set { _contentType = value; } } private int _retries; /// /// The number of retries of the request /// public int Retries { get { return _retries; } set { _retries = value; } } private float _retrySecondsDelay; /// /// Seconds of delay to make a retry /// public float RetrySecondsDelay { get { return _retrySecondsDelay; } set { _retrySecondsDelay = value; } } private Action _retryCallback; /// /// A callback executed before to retry a request /// public Action RetryCallback { get { return _retryCallback; } set { _retryCallback = value; } } private bool _enableDebug; /// /// Enable logs of the requests for debug mode /// public bool EnableDebug { get { return _enableDebug; } set { _enableDebug = value; } } private bool? _chunkedTransfer; /// /// Indicates whether the UnityWebRequest system should employ the HTTP/1.1 chunked-transfer encoding method. /// public bool? ChunkedTransfer { get { return _chunkedTransfer; } set { _chunkedTransfer = value; } } private bool? _useHttpContinue = true; /// /// Determines whether this UnityWebRequest will include Expect: 100-Continue in its outgoing request headers. (Default: true). /// public bool? UseHttpContinue { get { return _useHttpContinue; } set { _useHttpContinue = value; } } private int? _redirectLimit; /// /// Indicates the number of redirects which this UnityWebRequest will follow before halting with a “Redirect Limit Exceeded” system error. /// public int? RedirectLimit { get { return _redirectLimit; } set { _redirectLimit = value; } } private bool _ignoreHttpException; /// /// Prevent to catch http exceptions /// public bool IgnoreHttpException { get { return _ignoreHttpException; } set { _ignoreHttpException = value; } } private WWWForm _formData; /// /// The form data to send to the web server using WWWForm /// public WWWForm FormData { get { return _formData; } set { _formData = value; } } private Dictionary _simpleForm; /// /// The form data to send to the web server using Dictionary /// public Dictionary SimpleForm { get { return _simpleForm; } set { _simpleForm = value; } } private List _formSections; /// /// The form data to send to the web server using IMultipartFormSection /// public List FormSections { get { return _formSections; } set { _formSections = value; } } #if UNITY_2018_1_OR_NEWER private CertificateHandler _certificateHandler; /// /// Holds a reference to a CertificateHandler object, which manages certificate validation for this UnityWebRequest. /// public CertificateHandler CertificateHandler { get { return _certificateHandler; } set { _certificateHandler = value; } } #endif private UploadHandler _uploadHandler; /// /// Holds a reference to the UploadHandler object which manages body data to be uploaded to the remote server. /// public UploadHandler UploadHandler { get { return _uploadHandler; } set { _uploadHandler = value; } } private DownloadHandler _downloadHandler; /// /// Holds a reference to a DownloadHandler object, which manages body data received from the remote server by this UnityWebRequest. /// public DownloadHandler DownloadHandler { get { return _downloadHandler; } set { _downloadHandler = value; } } private Dictionary _headers; /// /// The HTTP headers added manually to send with the request /// public Dictionary Headers { get { if (_headers == null) { _headers = new Dictionary(); } return _headers; } set { _headers = value; } } private Dictionary _params; /// /// The HTTP query string params to send with the request /// public Dictionary Params { get { if (_params == null) { _params = new Dictionary(); } return _params; } set { _params = value; } } private bool _parseResponseBody = true; /// /// Whether to parse the response body as JSON or not. Note: parsing a large non-text file will have severe performance impact. /// public bool ParseResponseBody { get { return _parseResponseBody; } set { _parseResponseBody = value; } } } }