Cargando...
Buscando...
Nada coincide
Referencia de la clase Sage.ES.Onboarding.Clases.HttpRequestOnboarding

Clase responsable de hacer peticiones GET y POST http://stackoverflow.com/questions/4015324/http-request-with-post. Más...

Diagrama de herencia de Sage.ES.Onboarding.Clases.HttpRequestOnboarding
Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding Sage.ES.Onboarding.Clases.HttpRequestOnboardingSage50

Tipos públicos

enum  InternetConnectionState : int {
  INTERNET_CONNECTION_MODEM = 0x1 , INTERNET_CONNECTION_LAN = 0x2 , INTERNET_CONNECTION_PROXY = 0x4 , INTERNET_RAS_INSTALLED = 0x10 ,
  INTERNET_CONNECTION_OFFLINE = 0x20 , INTERNET_CONNECTION_CONFIGURED = 0x40
}
 InternetConnectionState. Más...
 

Métodos públicos

bool _CheckUrl (string tcUri)
 Comprueba si una URL existe.
 
string _Get (string tcURI, string tcTipo="WebClient")
 Petición GET Ejemplo: HttpRequest loObj = new HttpRequest(); string lcResponse = loObj._Get("http://domain.com");.
 
bool _Get (string tcUri, ref string tcResponse, string tcTipo="WebClient")
 Petición GET Ejemplo: string lcResponse = ""; HttpRequest loObj = new HttpRequest(); bool llOk = loObj._Get("http://domain.com", ref lcResponse);.
 
string _Post (string tcURI, string tcParameters="", string tcTipo="WebClient")
 Petición POST Ejemplo: HttpRequest loObj = new HttpRequest(); string lcResponse = loObj._Post("http://domain.com", "param1=valu1&param2=value2");.
 
bool _Post (string tcUri, ref string tcResponse, string tcParameters="", string tcTipo="WebClient")
 Petición POST Ejemplo: string lcResponse = ""; HttpRequest loObj = new HttpRequest(); bool llOk = loObj._Post("http://domain.com", ref lcResponse, "param1=valu1&param2=value2");.
 
string _Post (string tcURI, NameValueCollection tcParameters=null, string tcTipo="WebClient")
 Petición POST Ejemplo: NameValueCollection loParams = new NameValueCollection(); loParams["param1"] = "value1"; loParams["param2"] = "value2"; HttpRequest loObj = new HttpRequest(); string lcResponse = loObj._Post("http://domain.com", loParams);.
 
bool _Post (string tcURL, string tcParameters, ref HttpWebResponse toRespuesta)
 Post a la URL con los parámetros pasados por parámetro en formato parametros url.
 
bool _InternetOk_Deprecated ()
 Método para saber si tenemos conexión a internet.
 
static bool InternetGetConnectedState (ref InternetConnectionState lpdwFlags, int dwReserved)
 Función para comprobar si tenemos internet.
 
bool Upload (string tcURI, string tcFilePath, out string tcResponse)
 Método para subir un fichero a un servidor web mediante WebClient.
 

Métodos públicos estáticos

static bool InternetOk ()
 Método para saber si tenemos conexión a internet. Método alternativo porque a veces el anterior da falso positivo. Se han cambiado todas las instancias donde se llama al metodo del API InternetGetConnectedState directamente (no funciona en algunas m. virtuales) y la llamada de .NET: System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable (puede dar falsos positivos porque solo comprueba que estes en una LAN activa) https://stackoverflow.com/questions/2031824/what-is-the-best-way-to-check-for-internet-connectivity-using-net.
 

Campos de datos

Encoding _Encoding = Encoding.UTF8
 Encoding de las peticiones (solo implementado en WebClient). El encoding por defecto es : UTF8.
 

Propiedades

int _TimeOut = 15000 [get, set]
 Timeout en el metodo _CheckUrl.
 
string _User = string.Empty [get, set]
 Usuario para autenticación básica.
 
string _Pass = string.Empty [get, set]
 Password para autenticacion básica.
 
string _Error = string.Empty [get, set]
 En caso de error se rellena dicha propiedad.
 

Descripción detallada

Clase responsable de hacer peticiones GET y POST http://stackoverflow.com/questions/4015324/http-request-with-post.

Definición en la línea 17 del archivo HttpRequestOnboarding.cs.

Documentación de las enumeraciones miembro de la clase

◆ InternetConnectionState

InternetConnectionState.

Valores de enumeraciones
INTERNET_CONNECTION_MODEM 

Modem.

INTERNET_CONNECTION_LAN 

Lan.

INTERNET_CONNECTION_PROXY 

Proxy.

INTERNET_RAS_INSTALLED 

Ras.

INTERNET_CONNECTION_OFFLINE 

Offline.

INTERNET_CONNECTION_CONFIGURED 

Configured.

Definición en la línea 384 del archivo HttpRequestOnboarding.cs.

Documentación de funciones miembro

◆ _CheckUrl()

bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding._CheckUrl ( string tcUri)
inline

Comprueba si una URL existe.

Parámetros
tcUri
Devuelve

Implementa Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding.

Definición en la línea 55 del archivo HttpRequestOnboarding.cs.

◆ _Get() [1/2]

bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Get ( string tcUri,
ref string tcResponse,
string tcTipo = "WebClient" )
inline

Petición GET Ejemplo: string lcResponse = ""; HttpRequest loObj = new HttpRequest(); bool llOk = loObj._Get("http://domain.com", ref lcResponse);.

Parámetros
tcUriUrl de consulta
tcResponseResultado de la petición
tcTipoTipo de objeto a utilizar: WebClient o WebRequest
Devuelve
true si la petición ha terminado con exito, false en caso contrario

Implementa Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding.

Definición en la línea 121 del archivo HttpRequestOnboarding.cs.

◆ _Get() [2/2]

string Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Get ( string tcURI,
string tcTipo = "WebClient" )
inline

Petición GET Ejemplo: HttpRequest loObj = new HttpRequest(); string lcResponse = loObj._Get("http://domain.com");.

Parámetros
tcURIUrl de consulta
tcTipoTipo de objeto a utilizar: WebClient o WebRequest
Devuelve
Resultado de la petición

Definición en la línea 95 del archivo HttpRequestOnboarding.cs.

◆ _InternetOk_Deprecated()

bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding._InternetOk_Deprecated ( )
inline

Método para saber si tenemos conexión a internet.

Devuelve

Definición en la línea 321 del archivo HttpRequestOnboarding.cs.

◆ _Post() [1/4]

string Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Post ( string tcURI,
NameValueCollection tcParameters = null,
string tcTipo = "WebClient" )
inline

Petición POST Ejemplo: NameValueCollection loParams = new NameValueCollection(); loParams["param1"] = "value1"; loParams["param2"] = "value2"; HttpRequest loObj = new HttpRequest(); string lcResponse = loObj._Post("http://domain.com", loParams);.

Parámetros
tcURIURL de la petición
tcParametersParametros de la petición.
tcTipoTipo de objeto a utilizar: WebClient o WebRequest
Devuelve

Definición en la línea 210 del archivo HttpRequestOnboarding.cs.

◆ _Post() [2/4]

bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Post ( string tcUri,
ref string tcResponse,
string tcParameters = "",
string tcTipo = "WebClient" )
inline

Petición POST Ejemplo: string lcResponse = ""; HttpRequest loObj = new HttpRequest(); bool llOk = loObj._Post("http://domain.com", ref lcResponse, "param1=valu1&param2=value2");.

Parámetros
tcUriUrl de consulta
tcResponseResultado de la petición
tcParametersParametros de la peticion
tcTipoTipo de objeto a utilizar: WebClient o WebRequest
Devuelve
true si la petición ha terminado con exito, false en caso contrario

Definición en la línea 182 del archivo HttpRequestOnboarding.cs.

◆ _Post() [3/4]

string Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Post ( string tcURI,
string tcParameters = "",
string tcTipo = "WebClient" )
inline

Petición POST Ejemplo: HttpRequest loObj = new HttpRequest(); string lcResponse = loObj._Post("http://domain.com", "param1=valu1&param2=value2");.

Parámetros
tcURIURL de la petición
tcParametersParametros de la petición.
tcTipoTipo de objeto a utilizar: WebClient o WebRequest
Devuelve

Definición en la línea 152 del archivo HttpRequestOnboarding.cs.

◆ _Post() [4/4]

bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Post ( string tcURL,
string tcParameters,
ref HttpWebResponse toRespuesta )
inline

Post a la URL con los parámetros pasados por parámetro en formato parametros url.

Parámetros
tcURLURL del servicio
tcParametersParámatros a enviar al servicio
toRespuestaDevuelve por referencia el HttpWebResponse
Devuelve

Implementa Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding.

Definición en la línea 259 del archivo HttpRequestOnboarding.cs.

◆ InternetGetConnectedState()

static bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding.InternetGetConnectedState ( ref InternetConnectionState lpdwFlags,
int dwReserved )

Función para comprobar si tenemos internet.

Parámetros
lpdwFlags
dwReserved
Devuelve

◆ InternetOk()

static bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding.InternetOk ( )
inlinestatic

Método para saber si tenemos conexión a internet. Método alternativo porque a veces el anterior da falso positivo. Se han cambiado todas las instancias donde se llama al metodo del API InternetGetConnectedState directamente (no funciona en algunas m. virtuales) y la llamada de .NET: System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable (puede dar falsos positivos porque solo comprueba que estes en una LAN activa) https://stackoverflow.com/questions/2031824/what-is-the-best-way-to-check-for-internet-connectivity-using-net.

Devuelve
Bool con la disponibilidad de conexion a Internet

Definición en la línea 337 del archivo HttpRequestOnboarding.cs.

◆ Upload()

bool Sage.ES.Onboarding.Clases.HttpRequestOnboarding.Upload ( string tcURI,
string tcFilePath,
out string tcResponse )
inline

Método para subir un fichero a un servidor web mediante WebClient.

Parámetros
tcURIURI de la petición
tcFilePathRuta al fichero que se desea enviar
tcResponseRespuesta del servidor
Devuelve
true si existe respuesta, false en caso contrario

Definición en la línea 521 del archivo HttpRequestOnboarding.cs.

Documentación de campos

◆ _Encoding

Encoding Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Encoding = Encoding.UTF8

Encoding de las peticiones (solo implementado en WebClient). El encoding por defecto es : UTF8.

Definición en la línea 43 del archivo HttpRequestOnboarding.cs.

Documentación de propiedades

◆ _Error

string Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Error = string.Empty
getset

En caso de error se rellena dicha propiedad.

Implementa Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding.

Definición en la línea 37 del archivo HttpRequestOnboarding.cs.

◆ _Pass

string Sage.ES.Onboarding.Clases.HttpRequestOnboarding._Pass = string.Empty
getset

Password para autenticacion básica.

Implementa Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding.

Definición en la línea 33 del archivo HttpRequestOnboarding.cs.

◆ _TimeOut

int Sage.ES.Onboarding.Clases.HttpRequestOnboarding._TimeOut = 15000
getset

Timeout en el metodo _CheckUrl.

Implementa Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding.

Definición en la línea 25 del archivo HttpRequestOnboarding.cs.

◆ _User

string Sage.ES.Onboarding.Clases.HttpRequestOnboarding._User = string.Empty
getset

Usuario para autenticación básica.

Implementa Sage.ES.Onboarding.Interfaces.IHttpRequestOnboarding.

Definición en la línea 29 del archivo HttpRequestOnboarding.cs.


La documentación de esta clase está generada del siguiente archivo: