Sunday 19 November 2017

Curl Opción Binaria


Si esa pregunta está conectada a sus otras preguntas de Hudson utilice el comando que proporcionan. Necesita cambiar un poco para leer de un archivo: lea la página de manual. Siguiendo un resumen para el parámetro - d. (HTTP) Envía los datos especificados en una solicitud POST al servidor HTTP, de la misma manera que hace un navegador cuando un usuario ha rellenado un formulario HTML y presiona el botón Enviar. Esto hará que curl pase los datos al servidor usando el tipo de contenido application / x-www-form-urlencoded. Compare con el formato - F / -. - d / - los datos son los mismos que --data-ascii. Para publicar datos puramente binarios, debe usar la opción --data-binario. Para codificar URL el valor de un campo de formulario puede utilizar --data-urlencode. Si cualquiera de estas opciones se utiliza más de una vez en la misma línea de comandos, las piezas de datos especificadas se combinarán con un símbolo de amplificador separador. Por lo tanto, usar - d namedaniel - d skilllousy generaría un fragmento post que se parece a namedanielampskilllousy. Si inicia los datos con la letra, el resto debe ser un nombre de archivo para leer los datos o, si desea que curl lea los datos de stdin. El contenido del archivo debe estar ya codificado por URL. También se pueden especificar varios archivos. Publicar datos de un archivo llamado foobar se haría con --data foobar. Respondió Jun 9 10 at 17:55 Desde la página de manual. Creo que estos son los droides que estás buscando: (HTTP) Esto permite que curl emule un formulario rellenado en el que un usuario ha presionado el botón de envío. Esto provoca curl a datos POST utilizando el Content-Type multipart / form-data según RFC2388. Esto permite cargar archivos binarios, etc. Para forzar que la parte de contenido sea un archivo, prefija el nombre del archivo con un signo. Por ejemplo, para enviar su archivo de contraseña al servidor, donde password es el nombre del campo de formulario al cual / etc / passwd será la entrada: curl - F contraseña / etc / passwd mypasswords Así que en su caso, esto sería algo 8080 Con Jenkins 1.494, pude enviar un archivo a un parámetro de trabajo en Ubuntu Linux 12.10 utilizando curl con --form parámetros: En el Jenkins Servidor, configuré un trabajo que acepta un solo parámetro: un parámetro de carga de archivo llamado myfileparam. La primera línea de esa llamada curl construye un formulario web con un parámetro llamado myfileparam (igual que en el trabajo), su valor será el contenido de un archivo en el sistema de archivos local denominado /local/path/to/your/file. txt . El prefijo de símbolo indica a curl que envíe un archivo local en lugar del nombre de archivo dado. La segunda línea define una petición JSON que coincide con los parámetros de formulario en la línea uno: un parámetro de archivo denominado myfileparam. La tercera línea activa el botón Crear de formularios. La cuarta línea es la URL del trabajo con el sufijo / build. Si esta llamada tiene éxito, curl devuelve 0. Si no tiene éxito, el error o excepción del servicio se imprime en la consola. Esta respuesta toma mucho de una vieja entrada del blog referente a Hudson. Que deconstruí y volví a trabajar para mis propias necesidades. Respondió Mar 12 13 at 21:58 Heres cómo se puede POST XML en Windows utilizando curl línea de comandos en Windows. Mejor utilizar el archivo batch /.cmd para que: respondió 20 de noviembre 13 a las 16:16 Si tiene varios encabezados, entonces puede que desee utilizar lo siguiente: respondió 23 de julio a las 5:17 Si está utilizando curl en Windows: Curl es una herramienta para transferir datos desde o hacia un servidor, utilizando uno de los protocolos soportados (DICT, FILE, FTP , FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAP, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET y TFTP). El comando está diseñado para funcionar sin interacción del usuario. Curl ofrece un busload de trucos útiles como soporte de proxy, autenticación de usuario, carga FTP, post HTTP, conexiones SSL, cookies, reanudación de transferencia de archivos, Metalink y más. Como verá a continuación, el número de funciones hará que su curva de giro de la cabeza se alimente con libcurl para todas las funciones relacionadas con la transferencia. Consulte libcurl (3) para más detalles. URL La sintaxis de URL es dependiente del protocolo. Encontrará una descripción detallada en RFC 3986. Puede especificar varias URL o partes de URL escribiendo conjuntos de partes entre llaves como en: o puede obtener secuencias de series alfanuméricas utilizando como en: Las secuencias anidadas no son compatibles, pero puede utilizar Varios unos al lado del otro: Puede especificar cualquier cantidad de URL en la línea de comandos. Se buscarán de una manera secuencial en el orden especificado. Puede especificar un contador de pasos para los intervalos para obtener cada N o número de letras o letras: Cuando se utiliza o secuencias cuando se invoca desde un indicador de línea de comandos, es probable que tenga que colocar la URL completa entre comillas dobles para evitar que el intérprete de comandos interfiera con él. Esto también va para otros caracteres tratados especiales, como por ejemplo, y. Proporcione el índice de zona IPv6 en la URL con un signo de porcentaje de escape y el nombre de la interfaz. Al igual que en Si se especifica URL sin protocolo: // prefijo, Curl intentará adivinar qué protocolo puede que desee. A continuación, se aplicará por defecto a HTTP, pero probará otros protocolos basados ​​en prefijos de nombre de host utilizados con frecuencia. Por ejemplo, para nombres de host que comienzan con ftp. Curl asumirá que desea hablar FTP. Curl hará todo lo posible para usar lo que le pase como una URL. No está tratando de validarlo como una URL sintácticamente correcta por cualquier medio, pero es en cambio muy liberal con lo que acepta. Curl intentará reutilizar las conexiones para transferencias de archivos múltiples, de modo que obtener muchos archivos del mismo servidor no hará múltiples conexiones / apretones de manos. Esto mejora la velocidad. Por supuesto esto sólo se hace en los archivos especificados en una sola línea de comandos y no se puede utilizar entre curl invoca separado. PROGRESS METER curl normalmente muestra un medidor de progreso durante las operaciones, indicando la cantidad de datos transferidos, las velocidades de transferencia y el tiempo estimado restante, etc. El medidor de progreso muestra el número de bytes y las velocidades en bytes por segundo. Los sufijos (k, M, G, T, P) están basados ​​en 1024. Por ejemplo 1k es 1024 bytes. 1M tiene un tamaño de 1048576 bytes. Curl muestra estos datos al terminal de forma predeterminada, por lo que si invoca curl para hacer una operación y está a punto de escribir datos en el terminal, desactiva el medidor de progreso, ya que de lo contrario se ensuciaría el mezclador de resultados de mezcla y los datos de respuesta. Si desea un medidor de progreso para las solicitudes HTTP POST o PUT, debe redirigir la salida de la respuesta a un archivo, utilizando el redirector de shell (gt), el archivo - o o similar. No es el mismo caso para la carga FTP, ya que la operación no escupirá ningún dato de respuesta al terminal. Si prefiere una barra de progreso en lugar del medidor regular, -35 es su amigo. OPCIONES Las opciones comienzan con uno o dos guiones. Muchas de las opciones requieren un valor adicional junto a ellos. La forma corta de un solo trazo de las opciones, - d por ejemplo, se puede utilizar con o sin un espacio entre ella y su valor, aunque un espacio es un separador recomendado. La forma larga de doble guión, - datos por ejemplo, requiere un espacio entre él y su valor. Las opciones de versión corta que no necesitan valores adicionales se pueden utilizar inmediatamente al lado del otro, como por ejemplo, puede especificar todas las opciones - O, - L y - v a la vez como - OLv. En general, todas las opciones booleanas están habilitadas con - option y nuevamente desactivadas con - no - option. Es decir, se utiliza exactamente el mismo nombre de opción pero se prefiere con no-. Sin embargo, en esta lista en su mayoría solo listamos y mostramos la versión --option de ellos. (Este concepto con --no se ha añadido opciones en 7.19.0 Anteriormente, la mayoría de las opciones se activaban / desactivaban en el uso repetido de la misma opción de línea de comandos.) Haga que el progreso de la visualización de curvas sea una barra de progreso simple en lugar del estándar, más informativo , Metro. Indica a curl que utilice una operación independiente para la siguiente URL y las opciones asociadas. Esto le permite enviar varias solicitudes de URL, cada una con sus propias opciones específicas, por ejemplo, como diferentes nombres de usuario o solicitudes personalizadas para cada uno. (Añadido en 7.36.0) (HTTP) Indica a curl que utilice la versión 1.0 de HTTP en lugar de utilizar su preferencia interna: HTTP 1.1. (HTTP) Indica curl para usar HTTP versión 1.1. Esta es la versión interna predeterminada. (Agregado en 7.33.0) (HTTP) Indica a curl que emita sus peticiones usando HTTP 2. Esto requiere que el libcurl subyacente fuera construido para soportarlo. (Añadido en 7.33.0) (HTTP) Indica a curl que emita sus solicitudes HTTP no TLS utilizando HTTP / 2 sin la actualización HTTP / 1.1. Requiere conocimiento previo de que el servidor soporta HTTP / 2 inmediatamente. Las peticiones HTTPS seguirán haciendo HTTP / 2 de la manera estándar con la versión de protocolo negociada en el apretón de manos TLS. El soporte HTTP / 2 en general también requiere que el libcurl subyacente se haya creado para soportarlo. (Añadido en 7.49.0) Deshabilitar la extensión NPN TLS. NPN está habilitado de forma predeterminada si libcurl se ha creado con una biblioteca SSL que admite NPN. NPN es utilizado por un libcurl que soporta HTTP 2 para negociar la compatibilidad HTTP 2 con el servidor durante las sesiones https. Deshabilite la extensión ALPN TLS. ALPN está habilitado de forma predeterminada si libcurl se ha creado con una biblioteca SSL que admite ALPN. ALPN es utilizado por un libcurl que soporta HTTP 2 para negociar el soporte de HTTP 2 con el servidor durante las sesiones de https. (SSL) Obliga a curl a usar TLS versión 1.x al negociar con un servidor TLS remoto. Puede utilizar las opciones --tlsv1.0. --tlsv1.1. --tlsv1.2. Y --tlsv1.3 para controlar la versión TLS con mayor precisión (si el backend SSL en uso soporta tal nivel de control). (SSL) Las fuerzas curl utilizan SSL versión 2 cuando negocian con un servidor SSL remoto. A veces el rizo se construye sin soporte SSLv2. SSLv2 es ampliamente considerado inseguro (ver RFC 6176). (SSL) Fuerza el uso de la versión 3 de SSL cuando se negocia con un servidor SSL remoto. A veces el rizo se construye sin soporte SSLv3. SSLv3 es ampliamente considerado inseguro (ver RFC 7568). Esta opción le dice a curl que resuelva nombres solo a direcciones IPv4, y no por ejemplo intente IPv6. Esta opción le indica a curl que resuelva nombres solo a direcciones IPv6, y no por ejemplo intente IPv4. (FTP / SFTP) Cuando se utiliza en una subida, esto hace que el rizo se agregue al archivo de destino en lugar de sobrescribirlo. Si el archivo remoto no existe, se creará. Tenga en cuenta que este indicador es ignorado por algunos servidores SFTP (incluido OpenSSH). - A, --user-agent ltagent stringgt (HTTP) Especifica la cadena de User-Agent para enviar al servidor HTTP. Algunos CGIs mal ejecutados fallan si este campo no está establecido en Mozilla / 4.0. Para codificar espacios en blanco en la cadena, rodee la cadena con comillas simples. Esto también se puede configurar con la opción - H, --header, por supuesto. Si se utiliza esta opción varias veces, se utilizará la última. (HTTP) Le indica a Curl que determine por sí mismo el método de autenticación y utilice el más seguro que el sitio remoto solicite. Esto se hace primero realizando una petición y comprobando los encabezados de respuesta, lo que posiblemente induce una red extra de viaje extra. Esto se utiliza en lugar de establecer un método de autenticación específico, que puede hacer con --basic. --digerir. --ntlm. Y - negociar. Tenga en cuenta que el uso de --anyauth no se recomienda si realiza subidas desde stdin, ya que puede requerir que los datos se envíen dos veces y, a continuación, el cliente debe poder rebobinar. Si surge la necesidad al cargar desde stdin, la operación de carga fallará. - b, --cookie ltnamedatagt (HTTP) Transmita los datos al servidor HTTP como una cookie. Se supone que los datos recibidos previamente desde el servidor en un Set-Cookie: línea. Los datos deben estar en el formato NAME1VALUE1 NAME2VALUE2. Si no se utiliza ningún símbolo en la línea, se tratará como un nombre de archivo para utilizarlo para leer las líneas de cookies almacenadas anteriormente, las cuales deben utilizarse en esta sesión si coinciden. El uso de este método también activa el motor de cookies que hará curl grabar las cookies entrantes también, lo que puede ser útil si está usando esto en combinación con la opción - L, --location. El formato de archivo del archivo para leer las cookies debe ser encabezados HTTP simples (estilo Set-Cookie) o el formato de archivo de cookie Netscape / Mozilla. El archivo especificado con - b, --cookie sólo se utiliza como entrada. No se grabarán cookies en el archivo. Para almacenar cookies, use la opción - c, --cookie-jar. Tenga cuidado si está usando esta opción y pueden ocurrir múltiples transferencias. Si utiliza el formato NAME1VALUE1, o en un archivo utiliza el formato Set-Cookie y no especifica un dominio, la cookie se envía para cualquier dominio (incluso después de que se sigan los redireccionamientos) y no puede ser modificada por una cookie establecida por el servidor. Si el motor de cookies está habilitado y un servidor establece una cookie con el mismo nombre, ambos serán enviados en una futura transferencia a ese servidor, probablemente no lo que usted intentó. Para resolver estos problemas, establezca un dominio en Set-Cookie (haciendo que incluya subdominios) o utilice el formato Netscape. Si se utiliza esta opción varias veces, se utilizará la última. (FTP / LDAP) Habilita la transferencia ASCII. Para FTP, esto también se puede aplicar usando una URL que termina con typeA. Esta opción hace que los datos enviados a stdout estén en modo texto para sistemas win32. (HTTP) Indica curl para usar la autenticación HTTP Basic con el host remoto. Este es el valor predeterminado y esta opción suele carecer de sentido, a menos que la utilice para sustituir una opción previamente establecida que establezca un método de autenticación diferente (como --ntlm. --digest o --negotiate). - c, --cookie-jar ltfile namegt (HTTP) Especifique a qué archivo desea curl escribir todas las cookies después de una operación completada. Curl escribe todas las cookies leídas previamente de un archivo especificado, así como todas las cookies recibidas de servidores remotos. Si no se conocen cookies, no se escribirá ningún dato. El archivo se escribirá utilizando el formato de archivo de cookie de Netscape. Si configura el nombre del archivo en un solo guión, -, las cookies se escribirán en stdout. Esta opción de línea de comandos activará el motor de cookies que hace que se grabe y use cookies. Otra forma de activarlo es usar la opción - b, --cookie. Si no se puede crear o escribir el tarro de galletas, la operación de curl completa no fallará o incluso reportará un error claramente. El uso de - v obtendrá una advertencia, pero esa es la única información visible que obtienes sobre esta posible situación letal. Desde que 7.43.0 las cookies que se importaron en el formato Set-Cookie sin un nombre de dominio no se exportan con esta opción. Si se utiliza esta opción varias veces, se utilizará el último nombre de archivo especificado. - C, --continue-at ltoffsetgt Continuar / Reanudar una transferencia de archivo anterior en el offset dado. El desplazamiento dado es el número exacto de bytes que se omitirá, contando desde el principio del archivo de origen antes de ser transferido al destino. Si se utiliza con cargas, el comando de servidor FTP SIZE no se utilizará por curl. Utilice - C - para indicarle a curl que encuentre automáticamente dónde y cómo reanudar la transferencia. A continuación, utiliza los archivos de salida / entrada dada para averiguarlo. Si se utiliza esta opción varias veces, se utilizará la última. --ciphers ltlist de ciphersgt (SSL) Especifica qué cifras utilizar en la conexión. La lista de cifras debe especificar cifras válidas. Lea los detalles de la lista de cifrado SSL en esta URL: openssl. org/docs/apps/ciphers. html Las cifras NSS se realizan de forma diferente a OpenSSL y GnuTLS. La lista completa de cifras NSS se encuentra en la entrada NSSCipherSuite en esta dirección URL: git. fedorahosted. org/cgit/modnss. git/plain/docs/modnss. html35Directives Si se utiliza esta opción varias veces, se utilizará la última. (HTTP) Solicite una respuesta comprimida utilizando uno de los soportes de curvas de algoritmos y guarde el documento sin comprimir. Si se utiliza esta opción y el servidor envía una codificación no admitida, curl reportará un error. Tiempo máximo en segundos que permite la conexión de rizos. Esto limita solamente la fase de la conexión, así que si el enrollamiento conecta dentro del período dado continuará - si no él saldrá. Desde la versión 7.32.0, esta opción acepta valores decimales. Si se utiliza esta opción varias veces, se utilizará la última. Cuando se utiliza junto con la opción - o, curl creará la jerarquía de directorios local necesaria según sea necesario. Esta opción crea los dirs mencionados con la opción - o, nada más. Si el nombre de archivo - o no utiliza dir o si los dirs que menciona ya existen, no se creará dir. Para crear directorios remotos al usar FTP o SFTP, pruebe --ftp-create-dirs. Convertir LF a CRLF en la subida. Útil para MVS (OS / 390). (SMTP agregado en 7.40.0) (HTTPS / FTPS) Proporcione un archivo que utilice el formato PEM con una lista de revocación de certificados que puede especificar certificados pares que deben considerarse revocados. Si se utiliza esta opción varias veces, se utilizará la última. (HTTP) Envía los datos especificados en una solicitud POST al servidor HTTP, de la misma manera que hace un navegador cuando un usuario ha rellenado un formulario HTML y presiona el botón Enviar. Esto hará que curl pase los datos al servidor usando el tipo de contenido application / x-www-form-urlencoded. Compare con - F, --form. - d, --data es el mismo que --data-ascii. --data-raw es casi el mismo, pero no tiene una interpretación especial del personaje. Para publicar datos puramente binarios, debe usar la opción --data-binario. Para codificar URL el valor de un campo de formulario puede utilizar --data-urlencode. Si cualquiera de estas opciones se usa más de una vez en la misma línea de comandos, las piezas de datos especificadas se combinarán con un símbolo de separación. Por lo tanto, usar - d namedaniel - d skilllousy generaría un fragmento de mensaje que se parece a namedanielskilllousy. Si inicia los datos con la letra, el resto debe ser un nombre de archivo para leer los datos o, si desea que curl lea los datos de stdin. También se pueden especificar varios archivos. Publicar datos de un archivo llamado foobar se haría con --data foobar. Cuando --datos se le dice que lea de un archivo como ese, el carro regresa y las líneas de nuevo se eliminará. Si no desea que el personaje tenga una interpretación especial, use --data-raw en su lugar. - D, --dump-header ltfilegt Escriba los encabezados del protocolo en el archivo especificado. Esta opción es útil cuando se desea almacenar los encabezados que un sitio HTTP envía a usted. Las cookies de los encabezados podrían ser leídas en una segunda invocación de curvas usando la opción - b, --cookie La opción - c, --cookie-jar es una forma mejor de almacenar cookies. Cuando se utiliza en FTP, las líneas de respuesta del servidor FTP se consideran encabezados y, por lo tanto, se guardan allí. Si se utiliza esta opción varias veces, se utilizará la última. (HTTP) Esta cuenta con datos exactamente como se especifica sin ningún procesamiento adicional. Si inicia los datos con la letra, el resto debe ser un nombre de archivo. Los datos se contabilizan de la misma manera que --data-ascii, excepto que se conservan las líneas de nuevo y los retornos de carro y las conversiones nunca se hacen. Si esta opción se usa varias veces, las que siguen a la primera añadirán datos como se describe en - d, --data. (HTTP) Esta entrada de datos de forma similar a - datos, pero sin la interpretación especial del personaje. Vea - d, --datos. (Agregado en 7.43.0) (HTTP) Esta entrada de datos, similar a la otra - opciones de datos con la excepción de que esto realiza la codificación de URL. Para ser compatible con CGI, la parte ltdatagt debe comenzar con un nombre seguido por un separador y una especificación de contenido. La parte ltdatagt se puede pasar a curl utilizando una de las siguientes sintaxis: Esto hará curl URL-codificar el contenido y pasarlo. Sólo tenga cuidado para que el contenido no contiene ningún símbolo o, ya que entonces hará que la sintaxis coincidir con uno de los otros casos a continuación Esto hará curl URL-codificar el contenido y pasarlo. El símbolo anterior no está incluido en los datos. Esto hará curl URL-codificar la parte de contenido y pasar que en. Tenga en cuenta que se espera que la parte de nombre ya esté codificada por URL. Esto hará que los datos de carga de rizo desde el archivo dado (incluyendo cualquier nueva línea), la codificación de URL que los datos y pasarlo en el POST. Esto hará que los datos de carga de rizo desde el archivo dado (incluyendo cualquier nueva línea), la codificación de URL que los datos y pasarlo en el POST. La parte de nombre obtiene un signo de igualdad añadido, dando como resultado un nombre-archivo-contenido-contenido. Tenga en cuenta que se espera que el nombre ya esté codificado por URL. Establezca LEVEL para indicar al servidor lo que se le permite delegar cuando se trata de credenciales de usuario. Se utiliza con GSS / kerberos. No permita ninguna delegación. Delegados si y sólo si el indicador OK-AS-DELEGATE está establecido en el ticket de servicio de Kerberos, que es una cuestión de política de dominio. Permitir incondicionalmente que el servidor delegar. (HTTP) Habilita la autenticación HTTP Digest. Se trata de un esquema de autenticación que impide que la contraseña se envíe a través del cable en texto claro. Utilice esta opción en combinación con la opción normal - u, --user para establecer el nombre de usuario y la contraseña. Véase también --ntlm. --negotiate y --anyauth para las opciones relacionadas. Si se utiliza esta opción varias veces, sólo se utiliza la primera. (FTP) Tell curl para desactivar el uso de los comandos EPRT y LPRT al realizar transferencias FTP activas. Curl normalmente siempre primero intenta usar EPRT, luego LPRT antes de usar PORT, pero con esta opción, usará PORT de inmediato. EPRT y LPRT son extensiones al protocolo FTP original y pueden no funcionar en todos los servidores, pero permiten una mayor funcionalidad de una manera mejor que el comando PORT tradicional. --eprt puede utilizarse de forma explícita para habilitar de nuevo EPRT y --no-eprt es un alias para --disable-eprt. Si el servidor es un host IPv6, esta opción no tendrá ningún efecto, ya que EPRT es necesario entonces. La desactivación de EPRT sólo cambia el comportamiento activo. Si desea cambiar al modo pasivo, no debe usar - P, --ftp-port o forzarlo con --ftp-pasv. (FTP) Tell curl para desactivar el uso del comando EPSV al realizar transferencias FTP pasivas. Curl normalmente siempre primero intenta utilizar EPSV antes de PASV, pero con esta opción, no intentará usar EPSV. --epsv se puede utilizar para activar de forma explícita EPSV de nuevo y --no-epsv es un alias para --disable-epsv. Si el servidor es un host IPv6, esta opción no tendrá ningún efecto ya que EPSV es necesario. Deshabilitar EPSV sólo cambia el comportamiento pasivo. Si desea cambiar al modo activo, debe utilizar - P, --ftp-port. Tell curl para enviar peticiones DNS salientes a través de ltinterfacegt. Esta opción es una contraparte de --interface (que no afecta al DNS). La cadena suministrada debe ser un nombre de interfaz (no una dirección). Esta opción requiere que libcurl se construya con un backend de resolución que soporte esta operación. El backend c-ares es el único tal. (Agregado en 7.33.0) Tell curl para enlazar a ltip-addressgt al hacer IPv4 solicitudes de DNS, por lo que las peticiones DNS se originan de esta dirección. El argumento debe ser una sola dirección IPv4. Esta opción requiere que libcurl se construya con un backend de resolución que soporte esta operación. El backend c-ares es el único tal. (Agregado en 7.33.0) Tell curl para enlazar a ltip-addressgt al hacer peticiones DNS IPv6, para que las peticiones DNS se originen desde esta dirección. El argumento debe ser una sola dirección IPv6. Esta opción requiere que libcurl se construya con un backend de resolución que soporte esta operación. El backend c-ares es el único tal. (Añadido en 7.33.0) Establezca la lista de servidores DNS que se utilizarán en lugar de los valores predeterminados del sistema. La lista de direcciones IP debe separarse con comas. Los números de puerto también pueden darse opcionalmente como: ltport-numbergt después de cada dirección IP. Esta opción requiere que libcurl se construya con un backend de resolución que soporte esta operación. El backend c-ares es el único tal. (Agregado en 7.33.0) - e, --referer ltURLgt (HTTP) Envía la información de la página de referencia al servidor HTTP. Esto también se puede establecer con el indicador - H, --header, por supuesto. Cuando se utiliza con - L, --location, puede agregar auto a la URL --referer para que curl configure automáticamente la URL anterior cuando siga un encabezado Location :. La cadena automática se puede utilizar solo, aunque no se establezca un --referer inicial. Si se utiliza esta opción varias veces, se utilizará la última. - E, --cert ltcertificate: passwordgt (SSL) Indica a curl que utilice el archivo de certificado de cliente especificado al obtener un archivo con HTTPS, FTPS u otro protocolo basado en SSL. El certificado debe estar en formato PKCS3512 si utiliza transporte seguro o formato PEM si utiliza cualquier otro motor. Si no se especifica la contraseña opcional, se consultará en el terminal. Tenga en cuenta que esta opción supone un archivo de certificado que es la clave privada y el certificado de cliente concatenado Consulte - cert y - key para especificarlos de forma independiente. Si curl se construye contra la biblioteca SSL de NSS, esta opción puede indicar a curl el apodo del certificado para usarlo dentro de la base de datos NSS definida por la variable de entorno SSLDIR (o por defecto / etc / pki / nssdb). Si el módulo NMS PEM PKCS3511 (libnsspem. so) está disponible, es posible que se carguen archivos PEM. Si desea utilizar un archivo del directorio actual, sírvase precederlo con el prefijo ./, para evitar confusiones con un apodo. Si el apodo contiene:, debe ser precedido por para que no se reconozca como delimitador de contraseña. Si el apodo contiene, debe ser escapado para que no se reconozca como un carácter de escape. (IOS y macOS solamente) Si el curl se construye contra el transporte seguro, la cadena de certificados puede ser el nombre de un certificado / clave privada en el sistema o llavero de usuario o la ruta a un certificado PKCS3512 y una clave privada. Si desea utilizar un archivo del directorio actual, sírvase precederlo con el prefijo ./, para evitar confusiones con un apodo. Si se utiliza esta opción varias veces, se utilizará la última. Seleccione el motor de cifrado OpenSSL que se utilizará para las operaciones de cifrado. Utilice --engine list para imprimir una lista de motores compatibles con el tiempo de construcción. Tenga en cuenta que no todos (o ninguno) de los motores pueden estar disponibles en tiempo de ejecución. (RISC OS ONLY) Establece un rango de variables de entorno, utilizando los nombres que admite la opción - w para permitir una extracción más fácil de información útil después de ejecutar curl. (SSL) Especifique el nombre de la ruta de acceso al socket Entropy Gathering Daemon. El socket se utiliza para sembrar el motor aleatorio para las conexiones SSL. Véase también la opción --arandom-file. (HTTP) Tiempo máximo en segundos que permite que curl espere una respuesta 100-continue cuando curl emite un encabezado Espera: 100-continue en su petición. Por defecto curl espera un segundo. Esta opción acepta valores decimales Cuando el curl deja de esperar, continuará como si la respuesta se hubiera recibido. (SSL) Indica qué tipo de certificado tiene el certificado proporcionado. PEM, DER y ENG son tipos reconocidos. Si no se especifica, se supone PEM. Si se utiliza esta opción varias veces, se utilizará la última. --catert ltCA certificategt (SSL) Indica curl para usar el archivo de certificado especificado para verificar el par. El archivo puede contener varios certificados de CA. Los certificados deben estar en formato PEM. Normalmente curl se construye para utilizar un archivo predeterminado para esto, por lo que esta opción se suele utilizar para alterar ese archivo predeterminado. Curl reconoce la variable de entorno denominada CURLCABUNDLE si está establecida y utiliza la vía de acceso dada como ruta de acceso a un paquete cert de CA. Esta opción anula esa variable. La versión de curl de Windows buscará automáticamente un archivo certs de CA denominado acutecurl-ca-bundle. crtacute, en el mismo directorio que curl. exe, en el Directorio de trabajo actual o en cualquier carpeta a lo largo de PATH. Si el curl se construye contra la biblioteca SSL de NSS, el módulo NMS PEM PKCS3511 (libnsspem. so) debe estar disponible para que esta opción funcione correctamente. (IOS y macOS solamente) Si se ha creado curl con Secure Transport, esta opción se admite para compatibilidad con otros motores SSL, pero no debería establecerse. Si no se establece la opción, curl utilizará los certificados del sistema y del usuario Llavero para verificar el par, que es el método preferido para verificar la cadena de certificados de pares. Si se utiliza esta opción varias veces, se utilizará la última. --capath ltCA certificado directorygt (SSL) Indica curl para utilizar el directorio de certificados especificado para verificar el par. Pueden proporcionarse múltiples rutas separándolas con: (por ejemplo, path1: path2: path3). Los certificados deben estar en formato PEM y, si Curl está construido contra OpenSSL, el directorio debe haber sido procesado utilizando la utilidad crehash suministrada con OpenSSL. El uso de --capath puede permitir que Curls con OpenSSL realice conexiones SSL mucho más eficientemente que usar --cacert si el archivo --cacert contiene muchos certificados de CA. Si se establece esta opción, se ignorará el valor de capath por defecto y, si se utiliza varias veces, se utilizará el último. --pinnedpubkey ltpinned clave pública (hashes) gt (SSL) Indica curl para utilizar el archivo de clave pública especificado (o hashes) para verificar el par. Esto puede ser una ruta de acceso a un archivo que contiene una sola clave pública en formato PEM o DER, o cualquier número de hasas sha256 codificadas en base64 precedidas por acutesha256 // agudo y separadas por aguda aguda Al negociar una conexión TLS o SSL, el servidor envía una Certificado que indique su identidad. Una clave pública se extrae de este certificado y si no coincide exactamente con la clave pública proporcionada a esta opción, curl abortará la conexión antes de enviar o recibir cualquier dato. Soporte de PEM / DER: 7.39.0: OpenSSL, GnuTLS y GSKit 7.43.0: NSS y wolfSSL / CyaSSL 7.47.0: mbedtls 7.49.0: PolarSSL sha256 soporte: 7.44.0: OpenSSL, GnuTLS, NSS y wolfSSL / CyaSSL. 7.47.0: mbedtls 7.49.0: PolarSSL Otros soportes SSL no soportados. Si se utiliza esta opción varias veces, se utilizará la última. (SSL) Indica curl para verificar el estado del certificado del servidor utilizando la extensión TLS de Solicitud de estado del certificado (también llamada extensión OCSP). Si esta opción está habilitada y el servidor envía una respuesta no válida (por ejemplo, caducada), si la respuesta sugiere que se ha revocado el certificado del servidor o no se recibe ninguna respuesta, la verificación falla. En la actualidad sólo se implementa en los backends de OpenSSL, GnuTLS y NSS. (Agregado en 7.41.0) Fallar y salir en el primer error detectado. Cuando curl se utiliza para hacer múltiples transferencias en la línea de comandos, intentará operar en cada URL dado, uno por uno. De forma predeterminada, ignorará los errores si hay más URLs y el último éxito de las URL determinará la devolución de curvas de código de error. Así, las fallas tempranas serán ocultadas por las transferencias exitosas posteriores. Usando esta opción, curl devolverá un error en las primeras transferencias que fallan, independientemente de la cantidad de más URLs que se dan en la línea de comandos. De esta manera, no hay fallos de transferencia que no sean detectados por scripts y similares. Esta opción se aplicará a todas las direcciones URL, incluso si utiliza --next. (SSL) Indica curl para utilizar el inicio en falso durante el apretón de manos TLS. El inicio falso es un modo en el que un cliente TLS comenzará a enviar datos de aplicación antes de verificar el mensaje de finalización de los servidores, guardando así un viaje de ida y vuelta al realizar un apretón de manos completo. En la actualidad sólo se implementa en los backends NSS y Secure Transport (en iOS 7.0 o posterior, o OS X 10.9 o posterior). (Agregado en 7.42.0) (HTTP) Falla silenciosamente (sin salida en absoluto) en los errores del servidor. Esto se hace principalmente para mejorar la habilidad de scripts, etc para tratar mejor con los intentos fallidos. En casos normales, cuando un servidor HTTP no entrega un documento, devuelve un documento HTML que lo indica (que a menudo también describe por qué y más). This flag will prevent curl from outputting that and return error 22. This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407). - F, --form ltnamecontentgt (HTTP) This lets curl emulate a filled-in form in which a user has pressed the submit button. This causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388. This enables uploading of binary files etc. To force the content part to be a file, prefix the file name with an sign. To just get the content part from a file, prefix the file name with the symbol lt. The difference between and lt is then that makes a file get attached in the post as a file upload, while the lt makes a text field and just get the contents for that text field from a file. Example: to send an image to a server, where profile is the name of the form-field to which portrait. jpg will be the input: To read content from stdin instead of a file, use - as the filename. This goes for both and lt constructs. Unfortunately it does not support reading the file from a named pipe or similar, as it needs the full size before the transfer starts. You can also tell curl what Content-Type to use by using type, in a manner similar to: curl - F webindex. htmltypetext/html example curl - F namedanieltypetext/foo example You can also explicitly change the name field of a file upload part by setting filename, like this: curl - F filelocalfilefilenamenameinpost example If filename/path contains , or , it must be quoted by double-quotes like: curl - F filelocalfilefilenamenameinpost example curl - F filelocalfilefilenamenameinpost example Note that if a filename/path is quoted by double-quotes, any double-quote or backslash within the filename must be escaped by backslash. See further examples and details in the MANUAL. This option can be used multiple times. (FTP) When an FTP server asks for account data after user name and password has been provided, this data is sent off using the ACCT command. (Added in 7.13.0) If this option is used several times, the last one will be used. (FTP) If authenticating with the USER and PASS commands fails, send this command. When connecting to Tumbleweeds Secure Transport server over FTPS using a client certificate, using SITE AUTH will tell the server to retrieve the username from the certificate. (Added in 7.15.5) (FTP/SFTP) When an FTP or SFTP URL/operation uses a path that doesnt currently exist on the server, the standard behavior of curl is to fail. Using this option, curl will instead attempt to create missing directories. (FTP) Control what method curl should use to reach a file on an FTP(S) server. The method argument should be one of the following alternatives: curl does a single CWD operation for each path part in the given URL. For deep hierarchies this means very many commands. This is how RFC 1738 says it should be done. This is the default but the slowest behavior. curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full path to the server for all these commands. This is the fastest behavior. curl does one CWD with the full target directory and then operates on the file normally (like in the multicwd case). This is somewhat more standards compliant than nocwd but without the full penalty of multicwd. (FTP) Use passive mode for the data connection. Passive is the internal default behavior, but using this option can be used to override a previous - P/-ftp-port option. (Added in 7.11.0) If this option is used several times, only the first one is used. Undoing an enforced passive really isnt doable but you must then instead enforce the correct - P, --ftp-port again. Passive mode means that curl will try the EPSV command first and then PASV, unless --disable-epsv is used. (FTP) Tell curl to not use the IP address the server suggests in its response to curls PASV command when curl connects the data connection. Instead curl will re-use the same IP address it already uses for the control connection. (Added in 7.14.2) This option has no effect if PORT, EPRT or EPSV is used instead of PASV. (FTP) Tell curl to send a PRET command before PASV (and EPSV). Certain FTP servers, mainly drftpd, require this non-standard command for directory listings as well as up and downloads in PASV mode. (Added in 7.20.x) (FTP) Use CCC (Clear Command Channel) Shuts down the SSL/TLS layer after authenticating. The rest of the control channel communication will be unencrypted. This allows NAT routers to follow the FTP transaction. The default mode is passive. See --ftp-ssl-ccc-mode for other modes. (Added in 7.16.1) (FTP) Use CCC (Clear Command Channel) Sets the CCC mode. The passive mode will not initiate the shutdown, but instead wait for the server to do it, and will not reply to the shutdown from the server. The active mode initiates the shutdown and waits for a reply from the server. (Added in 7.16.2) (FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure authentication, but non-encrypted data transfers for efficiency. Fails the transfer if the server doesnt support SSL/TLS. (Added in 7.16.0) that can still be used but will be removed in a future version. (FTP) This deprecated option is now known as --ssl. (FTP) This deprecated option is now known as --ssl-reqd. (HTTP) Similar to --form except that the value string for the named parameter is used literally. Leading and lt characters, and the type string in the value have no special meaning. Use this in preference to --form if theres any possibility that the string value may accidentally trigger the or lt features of --form. This option switches off the URL globbing parser. When you set this option, you can specify URLs that contain the letters without having them being interpreted by curl itself. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard. When used, this option will make all data specified with - d, --data. --data-binary or --data-urlencode to be used in an HTTP GET request instead of the POST request that otherwise would be used. The data will be appended to the URL with a separator. If used in combination with - I, the POST data will instead be appended to the URL with a HEAD request. If this option is used several times, only the first one is used. This is because undoing a GET doesnt make sense, but you should then instead enforce the alternative method you prefer. - H, --header ltheadergt (HTTP) Extra header to include in the request when sending HTTP to a server. You may specify any number of extra headers. Note that if you should add a custom header that has the same name as one of the internal ones curl would use, your externally set header will be used instead of the internal one. This allows you to make even trickier stuff than curl would normally do. You should not replace internally set headers without knowing perfectly well what youre doing. Remove an internal header by giving a replacement without content on the right side of the colon, as in: - H Host:. If you send the custom header with no-value then its header must be terminated with a semicolon, such as - H X-Custom-Header to send X-Custom-Header:. curl will make sure that each header you add/replace is sent with the proper end-of-line marker, you should thus not add that as a part of the header content: do not add newlines or carriage returns, they will only mess things up for you. Starting in 7.37.0, you need --proxy-header to send custom headers intended for a proxy. ADVERTENCIA. headers set with this option will be set in all requests - even after redirects are followed, like when told with - L, --location. This can lead to the header being sent to other hosts than the original host, so sensitive headers should be used with caution combined with following redirects. This option can be used multiple times to add/replace/remove multiple headers. (SCP/SFTP) Pass a string containing 32 hexadecimal digits. The string should be the 128 bit MD5 checksum of the remote hosts public key, curl will refuse the connection with the host unless the md5sums match. (Added in 7.17.1) For HTTP, Ignore the Content-Length header. This is particularly useful for servers running Apache 1.x, which will report incorrect Content-Length for files larger than 2 gigabytes. For FTP (since 7.46.0), skip the RETR command to figure out the size before downloading a file. (HTTP) Include the HTTP-header in the output. The HTTP-header includes things like server-name, date of the document, HTTP-version and more. (HTTP/FTP/FILE) Fetch the HTTP-header only HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE file, curl displays the file size and last modification time only. Perform an operation using a specified interface. You can enter interface name, IP address or host name. An example could look like: If this option is used several times, the last one will be used. (HTTP) When curl is told to read cookies from a given file, this option will make it discard all session cookies. This will basically have the same effect as if a new session is started. Typical browsers always discard session cookies when theyre closed down. (HTTP) This option tells the - O, --remote-name option to use the server-specified Content-Disposition filename instead of extracting a filename from the URL. If the server specifies a file name and a file with that name already exists in the current working directory it will not be overwritten and an error will occur. If the server doesnt specify a file name then this option has no effect. Theres no attempt to decode - sequences (yet) in the provided file name, so this option may provide you with rather unexpected file names. ADVERTENCIA. Exercise judicious use of this option, especially on Windows. A rogue server could send you the name of a DLL or other file that could possibly be loaded automatically by Windows or some third party software. (SSL) This option explicitly allows curl to perform insecure SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered insecure fail unless - k, --insecure is used. See this online resource for further details: curl. haxx. se/docs/sslcerts. html - K, --config ltconfig filegt Specify which config file to read curl arguments from. The config file is a text file in which command line arguments can be written which then will be used as if they were written on the actual command line. Options and their parameters must be specified on the same config file line, separated by whitespace, colon, or the equals sign. Long option names can optionally be given in the config file without the initial double dashes and if so, the colon or equals characters can be used as separators. If the option is specified with one or two dashes, there can be no colon or equals character between the option and its parameter. If the parameter is to contain whitespace, the parameter must be enclosed within quotes. Within double quotes, the following escape sequences are available: , , t, n, r and v. A backslash preceding any other letter is ignored. If the first column of a config line is a 35 character, the rest of the line will be treated as a comment. Only write one option per physical line in the config file. Specify the filename to - K, --config as - to make curl read the file from stdin. Note that to be able to specify a URL in the config file, you need to specify it using the --url option, and not by simply writing the URL on its own line. So, it could look similar to this: When curl is invoked, it always (unless - q is used) checks for a default config file and uses it if found. The default config file is checked for in the following places in this order: 1) curl tries to find the home dir: It first checks for the CURLHOME and then the HOME environment variables. Failing that, it uses getpwuid() on Unix-like systems (which returns the home dir given the current user in your system). On Windows, it then checks for the APPDATA variable, or as a last resort the USERPROFILEApplication Data. 2) On windows, if there is no curlrc file in the home dir, it checks for one in the same dir the curl executable is placed. On Unix-like systems, it will simply try to load. curlrc from the determined home dir. This option can be used multiple times to load multiple config files. This option sets the time a connection needs to remain idle before sending keepalive probes and the time between individual keepalive probes. It is currently effective on operating systems offering the TCPKEEPIDLE and TCPKEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This option has no effect if --no-keepalive is used. (Added in 7.18.0) If this option is used several times, the last one will be used. If unspecified, the option defaults to 60 seconds. (SSL/SSH) Private key file name. Allows you to provide your private key in this separate file. For SSH, if not specified, curl tries the following candidates in order: /.ssh/iddsa, ./idrsa, ./iddsa. If this option is used several times, the last one will be used. (SSL) Private key file type. Specify which type your --key provided private key is. DER, PEM, and ENG are supported. If not specified, PEM is assumed. If this option is used several times, the last one will be used. (FTP) Enable Kerberos authentication and use. The level must be entered and should be one of clear, safe, confidential, or private. Should you use a level that is not one of these, private will instead be used. This option requires a library built with kerberos4 support. This is not very common. Use - V, --version to see if your curl supports it. If this option is used several times, the last one will be used. (FTP) This is the former name for --krb. Do not use. (FTP) When listing an FTP directory, this switch forces a name-only view. This is especially useful if the user wants to machine-parse the contents of an FTP directory since the normal directory view doesnt use a standard look or format. When used like this, the option causes a NLST command to be sent to the server instead of LIST. Note: Some FTP servers list only files in their response to NLST they do not include sub-directories and symbolic links. (POP3) When retrieving a specific email from POP3, this switch forces a LIST command to be performed instead of RETR. This is particularly useful if the user wants to see if a specific message id exists on the server and what size it is. Note: When combined with - X, --request ltcommandgt. this option can be used to send an UIDL command instead, so the user may use the emails unique identifier rather than its message id to make the request. (Added in 7.21.5) (HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place. If used together with - i, --include or - I, --head. headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the initial host. If a redirect takes curl to a different host, it wont be able to intercept the userpassword. See also --location-trusted on how to change this. You can limit the amount of redirects to follow by using the --max-redirs option. When curl follows a redirect and the request is not a plain GET (for example POST or PUT), it will do the following request with a GET if the HTTP response was 301, 302, or 303. If the response code was any other 3xx code, curl will re-send the following request using the same unmodified method. You can tell curl to not change the non-GET request method to GET after a 30x response by using the dedicated options for that: --post301. --post302 and --post303. Append this option to any ordinary curl command line, and you will get a libcurl-using C source code written to the file that does the equivalent of what your command-line operation does If this option is used several times, the last given file name will be used. (Added in 7.16.1) Specify the maximum transfer rate you want curl to use - for both downloads and uploads. This feature is useful if you have a limited pipe and youd like your transfer not to use your entire bandwidth. To make it slower than it otherwise would be. The given speed is measured in bytes/second, unless a suffix is appended. Appending k or K will count the number as kilobytes, m or M makes it megabytes, while g or G makes it gigabytes. Examples: 200K, 3m and 1G. If you also use the - Y, --speed-limit option, that option will take precedence and might cripple the rate-limiting slightly, to help keeping the speed-limit logic working. If this option is used several times, the last one will be used. Set a preferred number or range of local port numbers to use for the connection(s). Note that port numbers by nature are a scarce resource that will be busy at times so setting this range to something too narrow might cause unnecessary connection setup failures. (Added in 7.15.2) (HTTP/HTTPS) Like - L, --location. but will allow sending the name password to all hosts that the site may redirect to. This may or may not introduce a security breach if the site redirects you to a site to which youll send your authentication info (which is plaintext in the case of HTTP Basic authentication). - m, --max-time ltsecondsgt Maximum time in seconds that you allow the whole operation to take. This is useful for preventing your batch jobs from hanging for hours due to slow networks or links going down. Since 7.32.0, this option accepts decimal values, but the actual timeout will decrease in accuracy as the specified timeout increases in decimal precision. See also the --connect-timeout option. If this option is used several times, the last one will be used. Specify the login options to use during server authentication. You can use the login options to specify protocol specific options that may be used during authentication. At present only IMAP, POP3 and SMTP support login options. For more information about the login options please see RFC 2384. RFC 5092 and IETF draft draft-earhart-url-smtp-00.txt (Added in 7.34.0). If this option is used several times, the last one will be used. (SMTP) Specify a single address. This will be used to specify the authentication address (identity) of a submitted message that is being relayed to another server. (SMTP) Specify a single address that the given mail should get sent from. Specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and curl will return with exit code 63. NOTE: The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers. (SMTP) Specify a single address, user name or mailing list name. Repeat this option several times to send to multiple recipients. When performing a mail transfer, the recipient should specify a valid email address to send the mail to. (Added in 7.20.0) When performing an address verification (VRFY command), the recipient should be specified as the user name or user name and domain (as per Section 3.5 of RFC 5321 ). (Added in 7.34.0) When performing a mailing list expand (EXPN command), the recipient should be specified using the mailing list name, such as Friends or London-Office. (Added in 7.34.0) Set maximum number of redirection-followings allowed. If - L, --location is used, this option can be used to prevent curl from following redirections in absurdum. By default, the limit is set to 50 redirections. Set this option to -1 to make it limitless. If this option is used several times, the last one will be used. This option can tell curl to parse and process a given URI as Metalink file (both version 3 and 4 (RFC 5854) are supported) and make use of the mirrors listed within for failover if there are errors (such as the file or server not being available). It will also verify the hash of the file after the download completes. The Metalink file itself is downloaded and processed in memory and not stored in the local file system. Example to use a remote Metalink file: To use a Metalink file in the local file system, use FILE protocol (file://): curl --metalink file://example. metalink Please note that if FILE protocol is disabled, there is no way to use a local Metalink file at the time of this writing. Also note that if --metalink and --include are used together, --include will be ignored. This is because including headers in the response will break Metalink parser and if the headers are included in the file described in Metalink file, hash check will fail. (Added in 7.27.0, if built against the libmetalink library.) Makes curl scan the. netrc ( netrc on Windows) file in the users home directory for login name and password. This is typically used for FTP on Unix. If used with HTTP, curl will enable user authentication. See netrc(5) ftp(1) for details on the file format. Curl will not complain if that file doesnt have the right permissions (it should not be either world - or group-readable). The environment variable HOME is used to find the home directory. A quick and very simple example of how to setup a. netrc to allow curl to FTP to the machine host. domain with user name myself and password secret should look similar to: machine host. domain login myself password secret Disables the buffering of the output stream. In normal work situations, curl will use a standard buffered output stream that will have the effect that it will output the data in chunks, not necessarily exactly when the data arrives. Using this option will disable that buffering. Note that this is the negated option name documented. You can thus use --buffer to enforce the buffering. This option is similar to --netrc. except that you provide the path (absolute or relative) to the netrc file that Curl should use. You can only specify one netrc file per invocation. If several --netrc-file options are provided, only the last one will be used. (Added in 7.21.5) This option overrides any use of --netrc as they are mutually exclusive. It will also abide by --netrc-optional if specified. Very similar to --netrc. but this option makes the. netrc usage optional and not mandatory as the --netrc option does. (HTTP) Enables Negotiate (SPNEGO) authentication. If you want to enable Negotiate (SPNEGO) for proxy authentication, then use --proxy-negotiate. This option requires a library built with GSS-API or SSPI support. Use - V, --version to see if your curl supports GSS-API/SSPI and SPNEGO. When using this option, you must also provide a fake - u, --user option to activate the authentication code properly. Sending a - u : is enough as the user name and password from the - u option arent actually used. If this option is used several times, only the first one is used. Disables the use of keepalive messages on the TCP connection, as by default curl enables them. Note that this is the negated option name documented. You can thus use --keepalive to enforce keepalive. (SSL) Disable curls use of SSL session-ID caching. By default all transfers are done using the cache. Note that while nothing should ever get hurt by attempting to reuse SSL session-IDs, there seem to be broken SSL implementations in the wild that may require you to disable this in order for you to succeed. (Added in 7.16.0) Note that this is the negated option name documented. You can thus use --sessionid to enforce session-ID caching. Comma-separated list of hosts which do not use a proxy, if one is specified. The only wildcard is a single character, which matches all hosts, and effectively disables the proxy. Each name in this list is matched as either a domain which contains the hostname, or the hostname itself. For example, local would match local, local:80, and local, but not notlocal. (Added in 7.19.4). For a request to the given host:port pair, connect to connect-to-host:connect-to-port instead. This is suitable to direct the request at a specific server, e. g. at a specific cluster node in a cluster of servers. This option is only used to establish the network connection. It does NOT affect the hostname/port that is used for TLS/SSL (e. g. SNI, certificate verification) or for the application protocols. host and port may be the empty string, meaning any host/port. connect-to-host and connect-to-port may also be the empty string, meaning use the requests original host/port. This option can be used many times to add many connect rules. (Added in 7.49.0). (HTTP) Enables NTLM authentication. The NTLM authentication method was designed by Microsoft and is used by IIS web servers. It is a proprietary protocol, reverse-engineered by clever people and implemented in curl based on their efforts. This kind of behavior should not be endorsed, you should encourage everyone who uses NTLM to switch to a public and documented authentication method instead, such as Digest. If you want to enable NTLM for your proxy authentication, then use --proxy-ntlm. This option requires a library built with SSL support. Use - V, --version to see if your curl supports NTLM. If this option is used several times, only the first one is used. (HTTP) Enables NTLM much in the style --ntlm does, but hand over the authentication to the separate binary ntlmauth application that is executed when needed. - o, --output ltfilegt Write output to ltfilegt instead of stdout. If you are using or to fetch multiple documents, you can use 35 followed by a number in the ltfilegt specifier. That variable will be replaced with the current string for the URL being fetched. Like in: curl. example - o file351.txt or use several variables like: You may use this option as many times as the number of URLs you have. For example, if you specify two URLs on the same command line, you can use it like this: curl - o aa example - o bb example. net and the order of the - o options and the URLs doesnt matter, just that the first - o is for the first URL and so on, so the above command line can also be written as curl example example. net - o aa - o bb See also the --create-dirs option to create the local directories dynamically. Specifying the output as - (a single dash) will force the output to be done to stdout. Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.) The file will be saved in the current working directory. If you want the file saved in a different directory, make sure you change the current working directory before invoking curl with this option. The remote file name to use for saving is extracted from the given URL, nothing else, and if it already exists it will be overwritten. If you want the server to be able to choose the file name refer to - J, --remote-header-name which can be used in addition to this option. If the server chooses a file name and that name already exists it will not be overwritten. There is no URL decoding done on the file name. If it has 20 or other URL encoded parts of the name, they will end up as-is as file name. You may use this option as many times as the number of URLs you have. (IMAP, POP3, SMTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token is used in conjunction with the user name which can be specified as part of the --url or - u, --user options. The Bearer Token and user name are formatted according to RFC 6750. If this option is used several times, the last one will be used. (HTTP) Extra header to include in the request when sending HTTP to a proxy. You may specify any number of extra headers. This is the equivalent option to - H, --header but is for proxy communication only like in CONNECT requests when you want a separate header sent to the proxy to what is sent to the actual remote host. curl will make sure that each header you add/replace is sent with the proper end-of-line marker, you should thus not add that as a part of the header content: do not add newlines or carriage returns, they will only mess things up for you. Headers specified with this option will not be included in requests that curl knows will not be sent to a proxy. This option can be used multiple times to add/replace/remove multiple headers. When an HTTP proxy is used (-x, --proxy ), this option will cause non-HTTP protocols to attempt to tunnel through the proxy instead of merely using it to do HTTP-like operations. The tunnel approach is made with the HTTP proxy CONNECT request and requires that the proxy allows direct connect to the remote port number curl wants to tunnel through to. - P, --ftp-port ltaddressgt (FTP) Reverses the default initiator/listener roles when connecting with FTP. This switch makes curl use active mode. In practice, curl then tells the server to connect back to the clients specified address and port, while passive mode asks the server to setup an IP address and port for it to connect to. ltaddressgt should be one of: i. e eth0 to specify which interfaces IP address you want to use (Unix only) i. e 192.168.10.1 to specify the exact IP address i. e my. host. domain to specify the machine make curl pick the same IP address that is already used for the control connection If this option is used several times, the last one will be used. Disable the use of PORT with --ftp-pasv. Disable the attempt to use the EPRT command instead of PORT by using --disable-eprt. EPRT is really PORT. Starting in 7.19.5, you can append :start-end to the right of the address, to tell curl what TCP port range to use. That means you specify a port range, from a lower to a higher number. A single number works as well, but do note that it increases the risk of failure since the port may not be available. (SSL/SSH) Passphrase for the private key If this option is used several times, the last one will be used. Tell curl to not handle sequences of /../ or /./ in the given URL path. Normally curl will squash or merge them according to standards but with this option set you tell it not to do that. (HTTP) Tells curl to respect RFC 7230 /6.4.2 and not convert POST requests into GET requests when following a 301 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using - L, --location (Added in 7.17.1) (HTTP) Tells curl to respect RFC 7230 /6.4.3 and not convert POST requests into GET requests when following a 302 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using - L, --location (Added in 7.19.1) (HTTP) Tells curl to respect RFC 7230 /6.4.4 and not convert POST requests into GET requests when following a 303 redirection. The non-RFC behaviour is ubiquitous in web browsers, so curl does the conversion by default to maintain consistency. However, a server may require a POST to remain a POST after such a redirection. This option is meaningful only when using - L, --location (Added in 7.26.0) Tells curl to limit what protocols it may use in the transfer. Protocols are evaluated left to right, are comma separated, and are each a protocol name or all, optionally prefixed by zero or more modifiers. Available modifiers are: Permit this protocol in addition to protocols already permitted (this is the default if no modifier is used). - Deny this protocol, removing it from the list of protocols already permitted. Permit only this protocol (ignoring the list already permitted), though subject to later modification by subsequent entries in the comma separated list. --proto - ftps uses the default protocols, but disables ftps --proto http, https also only enables http and https Unknown protocols produce a warning. This allows scripts to safely rely on being able to disable potentially dangerous protocols, without relying upon support for that protocol being built into curl to avoid an error. This option can be used multiple times, in which case the effect is the same as concatenating the protocols into one instance of the option. Tells curl to use protocol for any URL missing a scheme name. --proto-default https ftp. mozilla. org An unknown or unsupported protocol causes error CURLEUNSUPPORTEDPROTOCOL. This option does not change the default proxy protocol (http). Without this option curl would make a guess based on the host, see --url for details. Tells curl to limit what protocols it may use on redirect. Protocols denied by --proto are not overridden by this option. See --proto for how protocols are represented. Allow only HTTP and HTTPS on redirect. By default curl will allow all protocols on redirect except several disabled for security reasons: Since 7.19.4 FILE and SCP are disabled, and since 7.40.0 SMB and SMBS are also disabled. Specifying all or all enables all protocols on redirect, including those disabled for security. Tells curl to pick a suitable authentication method when communicating with the given proxy. This might cause an extra request/response round-trip. (Added in 7.13.2) Tells curl to use HTTP Basic authentication when communicating with the given proxy. Use --basic for enabling HTTP Basic with a remote host. Basic is the default authentication method curl uses with proxies. Tells curl to use HTTP Digest authentication when communicating with the given proxy. Use --digest for enabling HTTP Digest with a remote host. Tells curl to use HTTP Negotiate (SPNEGO) authentication when communicating with the given proxy. Use --negotiate for enabling HTTP Negotiate (SPNEGO) with a remote host. (Added in 7.17.1) Tells curl to use HTTP NTLM authentication when communicating with the given proxy. Use --ntlm for enabling NTLM with a remote host. This option allows you to change the service name for proxy negotiation. Examples: --proxy-negotiate proxy-name --proxy-service-name sockd would use sockd/proxy-name. (Added in 7.43.0). Use the specified HTTP 1.0 proxy. If the port number is not specified, it is assumed at port 1080. The only difference between this and the HTTP proxy option (-x, --proxy ), is that attempts to use CONNECT through the proxy will specify an HTTP 1.0 protocol instead of the default HTTP 1.1. (SSH) Public key file name. Allows you to provide your public key in this separate file. If this option is used several times, the last one will be used. (As of 7.39.0, curl attempts to automatically extract the public key from the private key file, so passing this option is generally not required. Note that this public key extraction requires libcurl to be linked against a copy of libssh2 1.2.8 or higher that is itself linked against OpenSSL.) If used as the first parameter on the command line, the curlrc config file will not be read and used. See the - K, --config for details on the default config file search path. - Q, --quote ltcommandgt (FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote commands are sent BEFORE the transfer takes place (just after the initial PWD command in an FTP transfer, to be exact). To make commands take place after a successful transfer, prefix them with a dash -. To make commands be sent after curl has changed the working directory, just before the transfer command(s), prefix the command with a (this is only supported for FTP). You may specify any number of commands. If the server returns failure for one of the commands, the entire operation will be aborted. You must send syntactically correct FTP commands as RFC 959 defines to FTP servers, or one of the commands listed below to SFTP servers. This option can be used multiple times. When speaking to an FTP server, prefix the command with an asterisk () to make curl continue even if the command fails as by default curl will stop at first failure. SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands itself before sending them to the server. File names may be quoted shell-style to embed spaces or special characters. Following is the list of all supported SFTP quote commands: chgrp group file The chgrp command sets the group ID of the file named by the file operand to the group ID specified by the group operand. The group operand is a decimal integer group ID. chmod mode file The chmod command modifies the file mode bits of the specified file. The mode operand is an octal integer mode number. chown user file The chown command sets the owner of the file named by the file operand to the user ID specified by the user operand. The user operand is a decimal integer user ID. ln sourcefile targetfile The ln and symlink commands create a symbolic link at the targetfile location pointing to the sourcefile location. The mkdir command creates the directory named by the directoryname operand. The pwd command returns the absolute pathname of the current working directory. rename source target The rename command renames the file or directory named by the source operand to the destination path named by the target operand. The rm command removes the file specified by the file operand. The rmdir command removes the directory entry specified by the directory operand, provided it is empty. symlink sourcefile targetfile - r, --range ltrangegt (HTTP/FTP/SFTP/FILE) Retrieve a byte range (i. e a partial document) from a HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified in a number of ways. 0-499 specifies the first 500 bytes 500-999 specifies the second 500 bytes -500 specifies the last 500 bytes 9500- specifies the bytes from offset 9500 and forward 0-0,-1 specifies the first and last byte only()(HTTP) 100-199,500-599 specifies two separate 100-byte ranges() (HTTP) () NOTE that this will cause the server to reply with a multipart response Only digit characters (0-9) are valid in the start and stop fields of the start-stop range syntax. If a non-digit character is given in the range, the servers response will be unspecified, depending on the servers configuration. You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, youll instead get the whole document. FTP and SFTP range downloads only support the simple start-stop syntax (optionally with one of the numbers omitted). FTP use depends on the extended FTP command SIZE. If this option is used several times, the last one will be used. When used, this will make curl attempt to figure out the timestamp of the remote file, and if that is available make the local file get that same timestamp. (SSL) Specify the path name to file containing what will be considered as random data. The data is used to seed the random engine for SSL connections. See also the --egd-file option. (HTTP) When used, it disables all internal HTTP decoding of content or transfer encodings and instead makes them passed on unaltered, raw. (Added in 7.16.2) This option changes the default action for all given URLs to be dealt with as if - O, --remote-name were used for each one. So if you want to disable that for a specific URL after --remote-name-all has been used, you must use - o - or --no-remote-name. (Added in 7.19.0) Provide a custom address for a specific host and port pair. Using this, you can make the curl requests(s) use a specified address and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line. The port number should be the number used for the specific protocol the host will be used for. It means you need several entries if you want to provide address for the same host but different ports. The provided address set by this option will be used even if -4, --ipv4 or -6, --ipv6 is set to make curl use another IP version. This option can be used many times to add many host names to resolve. If a transient error is returned when curl tries to perform a transfer, it will retry this number of times before giving up. Setting the number to 0 makes curl do no retries (which is the default). Transient error means either: a timeout, an FTP 4xx response code or an HTTP 5xx response code. When curl is about to retry a transfer, it will first wait one second and then for all forthcoming retries it will double the waiting time until it reaches 10 minutes which then will be the delay between the rest of the retries. By using --retry-delay you disable this exponential backoff algorithm. See also --retry-max-time to limit the total time allowed for retries. (Added in 7.12.3) If this option is used several times, the last one will be used. In addition to the other conditions, consider ECONNREFUSED as a transient error too for --retry. This option is used together with --retry. (Added in 7.52.0) Make curl sleep this amount of time before each retry when a transfer has failed with a transient error (it changes the default backoff time algorithm between retries). This option is only interesting if --retry is also used. Setting this delay to zero will make curl use the default backoff time. (Added in 7.12.3) If this option is used several times, the last one will be used. The retry timer is reset before the first transfer attempt. Retries will be done as usual (see --retry ) as long as the timer hasnt reached this given limit. Notice that if the timer hasnt reached the limit, the request will be made and while performing, it may take longer than this given time period. To limit a single requestacutes maximum time, use - m, --max-time. Set this option to zero to not timeout retries. (Added in 7.12.3) If this option is used several times, the last one will be used. Silent or quiet mode. Dont show progress meter or error messages. Makes Curl mute. It will still output the data you ask for, potentially even to the terminal/stdout unless you redirect it. Enable initial response in SASL authentication. (Added in 7.31.0) This option allows you to change the service name for SPNEGO. Examples: --negotiate --service-name sockd would use sockd/server-name. (Added in 7.43.0). When used with - s it makes curl show an error message if it fails. (FTP, POP3, IMAP, SMTP) Try to use SSL/TLS for the connection. Reverts to a non-secure connection if the server doesnt support SSL/TLS. See also --ftp-ssl-control and --ssl-reqd for different levels of encryption required. (Added in 7.20.0) This option was formerly known as --ftp-ssl (Added in 7.11.0). That option name can still be used but will be removed in a future version. (FTP, POP3, IMAP, SMTP) Require SSL/TLS for the connection. Terminates the connection if the server doesnt support SSL/TLS. (Added in 7.20.0) This option was formerly known as --ftp-ssl-reqd. (SSL) This option tells curl to not work around a security flaw in the SSL3 and TLS1.0 protocols known as BEAST. If this option isnt used, the SSL layer may use workarounds known to cause interoperability problems with some older SSL implementations. WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that. (Added in 7.25.0) (WinSSL) This option tells curl to disable certificate revocation checks. WARNING: this option loosens the SSL security, and by using this flag you ask for exactly that. (Added in 7.44.0) Use the specified SOCKS4 proxy. If the port number is not specified, it is assumed at port 1080. (Added in 7.15.2) This option overrides any previous use of - x, --proxy. as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks4 proxy with - x, --proxy using a socks4:// protocol prefix. If this option is used several times, the last one will be used. Use the specified SOCKS4a proxy. If the port number is not specified, it is assumed at port 1080. (Added in 7.18.0) This option overrides any previous use of - x, --proxy. as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks4a proxy with - x, --proxy using a socks4a:// protocol prefix. If this option is used several times, the last one will be used. Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If the port number is not specified, it is assumed at port 1080. (Added in 7.18.0) This option overrides any previous use of - x, --proxy. as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks5 hostname proxy with - x, --proxy using a socks5h:// protocol prefix. If this option is used several times, the last one will be used. (This option was previously wrongly documented and used as --socks without the number appended.) Use the specified SOCKS5 proxy - but resolve the host name locally. If the port number is not specified, it is assumed at port 1080. This option overrides any previous use of - x, --proxy. as they are mutually exclusive. Since 7.21.7, this option is superfluous since you can specify a socks5 proxy with - x, --proxy using a socks5:// protocol prefix. If this option is used several times, the last one will be used. (This option was previously wrongly documented and used as --socks without the number appended.) This option (as well as --socks4 ) does not work with IPV6, FTPS or LDAP. The default service name for a socks server is rcmd/server-fqdn. This option allows you to change it. Examples: --socks5 proxy-name --socks5-gssapi-service sockd would use sockd/proxy-name --socks5 proxy-name --socks5-gssapi-service sockd/real-name would use sockd/real-name for cases where the proxy-name does not match the principal name. (Added in 7.19.4). As part of the GSS-API negotiation a protection mode is negotiated. RFC 1961 says in section 4.3/4.4 it should be protected, but the NEC reference implementation does not. The option --socks5-gssapi-nec allows the unprotected exchange of the protection mode negotiation. (Added in 7.19.4). Redirect all writes to stderr to the specified file instead. If the file name is a plain -, it is instead written to stdout. If this option is used several times, the last one will be used. - t, --telnet-option ltOPTvalgt Pass options to the telnet protocol. Supported options are: TTYPElttermgt Sets the terminal type. XDISPLOCltX displaygt Sets the X display location. NEWENVltvar, valgt Sets an environment variable. - T, --upload-file ltfilegt This transfers the specified local file to the remote URL. If there is no file part in the specified URL, Curl will append the local file name. NOTE that you must use a trailing / on the last directory to really prove to Curl that there is no file name or curl will think that your last directory name is the remote file name to use. That will most likely cause the upload operation to fail. If this is used on an HTTP(S) server, the PUT command will be used. Use the file name - (a single dash) to use stdin instead of a given file. Alternately, the file name . (a single period) may be specified instead of - to use stdin in non-blocking mode to allow reading server output while stdin is being uploaded. You can specify one - T for each URL on the command line. Each - T URL pair specifies what to upload and to where. curl also supports globbing of the - T argument, meaning that you can upload multiple files to a single URL by using the same URL globbing style supported in the URL, like this: When uploading to an SMTP server: the uploaded data is assumed to be RFC 5322 formatted. It has to feature the necessary set of headers and mail body formatted correctly by the user as curl will not transcode nor encode it further in any way. Turn on the TCPNODELAY option. See the curleasysetopt(3) man page for details about this option. (Added in 7.11.2) Enable use of TCP Fast Open (RFC7413). (Added in 7.49.0) (TFTP) Set TFTP BLKSIZE option (must be gt512). This is the block size that curl will try to use when transferring data to or from a TFTP server. By default 512 bytes will be used. If this option is used several times, the last one will be used. (TFTP) Tells curl not to send TFTP options requests. This option improves interop with some legacy servers that do not acknowledge or properly implement TFTP options. When this option is used --tftp-blksize is ignored. Set TLS authentication type. Currently, the only supported option is SRP, for TLS-SRP (RFC 5054). If --tlsuser and --tlspassword are specified but --tlsauthtype is not, then this option defaults to SRP. (Added in 7.21.4) Set password for use with the TLS authentication method specified with --tlsauthtype. Requires that --tlsuser also be set. (Added in 7.21.4) Set username for use with the TLS authentication method specified with --tlsauthtype. Requires that --tlspassword also be set. (Added in 7.21.4) (SSL) Forces curl to use TLS version 1.0 when negotiating with a remote TLS server. (Added in 7.34.0) (SSL) Forces curl to use TLS version 1.1 when negotiating with a remote TLS server. (Added in 7.34.0) (SSL) Forces curl to use TLS version 1.2 when negotiating with a remote TLS server. (Added in 7.34.0) (SSL) Forces curl to use TLS version 1.3 when negotiating with a remote TLS server. (Added in 7.51.1) (HTTP) Request a compressed Transfer-Encoding response using one of the algorithms curl supports, and uncompress the data while receiving it. Enables a full trace dump of all incoming and outgoing data, including descriptive information, to the given output file. Use - as filename to have the output sent to stdout. Use as filename to have the output sent to stderr. If this option is used several times, the last one will be used. Enables a full trace dump of all incoming and outgoing data, including descriptive information, to the given output file. Use - as filename to have the output sent to stdout. This is very similar to --trace. but leaves out the hex part and only shows the ASCII part of the dump. It makes smaller output that might be easier to read for untrained humans. This option overrides previous uses of - v, --verbose or --trace. If this option is used several times, the last one will be used. Prepends a time stamp to each trace or verbose line that curl displays. (Added in 7.14.0) (HTTP) Connect through this Unix domain socket, instead of using the network. (Added in 7.40.0) - u, --user ltuser:passwordgt Specify the user name and password to use for server authentication. Overrides - n, --netrc and --netrc-optional. If you simply specify the user name, curl will prompt for a password. The user name and passwords are split up on the first colon, which makes it impossible to use a colon in the user name with this option. The password can, still. When using Kerberos V5 with a Windows based server you should include the Windows domain name in the user name, in order for the server to successfully obtain a Kerberos Ticket. If you dont then the initial authentication handshake may fail. When using NTLM, the user name can be specified simply as the user name, without the domain, if there is a single domain and forest in your setup for example. To specify the domain name use either Down-Level Logon Name or UPN (User Principal Name) formats. For example, EXAMPLEuser and userexample respectively. If you use a Windows SSPI-enabled curl binary and perform Kerberos V5, Negotiate, NTLM or Digest authentication then you can tell curl to select the user name and password from your environment by specifying a single colon with this option: - u :. If this option is used several times, the last one will be used. - U, --proxy-user ltuser:passwordgt Specify the user name and password to use for proxy authentication. If you use a Windows SSPI-enabled curl binary and do either Negotiate or NTLM authentication then you can tell curl to select the user name and password from your environment by specifying a single colon with this option: - U :. If this option is used several times, the last one will be used. Specify a URL to fetch. This option is mostly handy when you want to specify URL(s) in a config file. If the given URL is missing a scheme name (such as or ftp:// etc) then curl will make a guess based on the host. If the outermost sub-domain name matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol will be used, otherwise HTTP will be used. Since 7.45.0 guessing can be disabled by setting a default protocol, see --proto-default for details. This option may be used any number of times. To control where this URL is written, use the - o, --output or the - O, --remote-name options. Be more verbose/talkative during the operation. Useful for debugging and seeing whats going on under the hood. A line starting with gt means header data sent by curl, lt means header data received by curl that is hidden in normal cases, and a line starting with means additional info provided by curl. Note that if you only want HTTP headers in the output, - i, --include might be the option youre looking for. If you think this option still doesnt give you enough details, consider using --trace or --trace-ascii instead. This option overrides previous uses of --trace-ascii or --trace. Use - s, --silent to make curl quiet. - w, --write-out ltformatgt Make curl display information on stdout after a completed transfer. The format is a string that may contain plain text mixed with any number of variables. The format can be specified as a literal string, or you can have curl read the format from a file with filename and to tell curl to read the format from stdin you write -. The variables present in the output format will be substituted by the value or text that curl thinks fit, as described below. All variables are specified as and to output a normal you just write them as . You can output a newline by using n, a carriage return with r and a tab space with t. NOTE: The - symbol is a special symbol in the win32-environment, where all occurrences of must be doubled when using this option. The variables available are: contenttype The Content-Type of the requested document, if there was any. filenameeffective The ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the --remote-name or --output option. Its most useful in combination with the --remote-header-name option. (Added in 7.26.0) ftpentrypath The initial path curl ended up in when logging on to the remote FTP server. (Added in 7.15.4) httpcode The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. In 7.18.2 the alias responsecode was added to show the same info. httpconnect The numerical code that was found in the last response (from a proxy) to a curl CONNECT request. (Added in 7.12.4) httpversion The http version that was effectively used. (Added in 7.50.0) localip The IP address of the local end of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0) localport The local port number of the most recently done connection (Added in 7.29.0) numconnects Number of new connects made in the recent transfer. (Added in 7.12.3) numredirects Number of redirects that were followed in the request. (Added in 7.12.3) redirecturl When an HTTP request was made without - L to follow redirects, this variable will show the actual URL a redirect would take you to. (Added in 7.18.2) remoteip The remote IP address of the most recently done connection - can be either IPv4 or IPv6 (Added in 7.29.0) remoteport The remote port number of the most recently done connection (Added in 7.29.0) sizedownload The total amount of bytes that were downloaded. sizeheader The total amount of bytes of the downloaded headers. sizerequest The total amount of bytes that were sent in the HTTP request. sizeupload The total amount of bytes that were uploaded. speeddownload The average download speed that curl measured for the complete download. Bytes per second. speedupload The average upload speed that curl measured for the complete upload. Bytes per second. sslverifyresult The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. (Added in 7.19.0) timeappconnect The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. (Added in 7.19.0) timeconnect The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed. timenamelookup The time, in seconds, it took from the start until the name resolving was completed. timepretransfer The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. timeredirect The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. timeredirect shows the complete execution time for multiple redirections. (Added in 7.12.3) timestarttransfer The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes timepretransfer and also the time the server needed to calculate the result. timetotal The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution. urleffective The URL that was fetched last. This is most meaningful if youve told curl to follow location: headers. If this option is used several times, the last one will be used. - x, --proxy ltprotocol://user:passwordproxyhost:portgt Use the specified proxy. The proxy string can be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// to request the specific SOCKS version to be used. No protocol specified, and all others will be treated as HTTP proxies. (The protocol support was added in curl 7.21.7) If the port number is not specified in the proxy string, it is assumed to be 1080. This option overrides existing environment variables that set the proxy to use. If theres an environment variable setting a proxy, you can set proxy to to override it. All operations that are performed over an HTTP proxy will transparently be converted to HTTP. It means that certain protocol specific operations might not be available. This is not the case if you can tunnel through the proxy, as one with the - p, --proxytunnel option. User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as by using 40 or pass in a colon with 3a. The proxy host can be specified the exact same way as the proxy environment variables, including the protocol prefix () and the embedded user password. If this option is used several times, the last one will be used. - X, --request ltcommandgt (HTTP) Specifies a custom request method to use when communicating with the HTTP server. The specified request method will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more. Normally you dont need this option. All sorts of GET, HEAD, POST and PUT requests are rather invoked by using dedicated command line options. This option only changes the actual word used in the HTTP request, it does not alter the way curl behaves. So for example if you want to make a proper HEAD request, using - X HEAD will not suffice. You need to use the - I, --head option. The method string you set with - X will be used for all requests, which if you for example use - L, --location may cause unintended side-effects when curl doesnt change request method according to the HTTP 30x response codes - and similar. (FTP) Specifies a custom FTP command to use instead of LIST when doing file lists with FTP. (POP3) Specifies a custom POP3 command to use instead of LIST or RETR. (Added in 7.26.0) (IMAP) Specifies a custom IMAP command to use instead of LIST. (Added in 7.30.0) (SMTP) Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0) If this option is used several times, the last one will be used. When saving output to a file, this option tells curl to store certain file metadata in extended file attributes. Currently, the URL is stored in the xdg. origin. url attribute and, for HTTP, the content type is stored in the mimetype attribute. If the file system does not support extended attributes, a warning is issued. - y, --speed-time lttimegt If a download is slower than speed-limit bytes per second during a speed-time period, the download gets aborted. If speed-time is used, the default speed-limit will be 1 unless set with - Y. This option controls transfers and thus will not affect slow connects etc. If this is a concern for you, try the --connect-timeout option. If this option is used several times, the last one will be used. - Y, --speed-limit ltspeedgt If a download is slower than this given speed (in bytes per second) for speed-time seconds it gets aborted. speed-time is set with - y and is 30 if not set. If this option is used several times, the last one will be used. - z, --time-cond ltdate expressiongtltfilegt (HTTP/FTP) Request a file that has been modified later than the given time and date, or one that has been modified before that time. The ltdate expressiongt can be all sorts of date strings or if it doesnt match any internal ones, it is taken as a filename and tries to get the modification date (mtime) from ltfilegt instead. See the curlgetdate(3) man pages for date expression details. Start the date expression with a dash (-) to make it request for a document that is older than the given date/time, default is a document that is newer than the specified date/time. If this option is used several times, the last one will be used. Usage help. This lists all current command line options with a short description. Manual. Display the huge help text. Displays information about curl and the libcurl version it uses. The first line includes the full version of curl, libcurl and other 3rd party libraries linked with the executable. The second line (starts with Protocols:) shows all protocols that libcurl reports to support. The third line (starts with Features:) shows specific features libcurl reports to offer. Available features include: You can use IPv6 with this. Krb4 for FTP is supported. SSL versions of various protocols are supported, such as HTTPS, FTPS, POP3S and so on. Automatic decompression of compressed files over HTTP is supported. NTLM authentication is supported. This curl uses a libcurl built with Debug. This enables more error-tracking and memory debugging etc. For curl-developers only This curl uses asynchronous name resolves. Asynchronous name resolves can be done using either the c-ares or the threaded resolver backends. SPNEGO authentication is supported. This curl supports transfers of large files, files larger than 2GB. This curl supports IDN - international domain names. GSS-API is supported. SSPI is supported. SRP (Secure Remote Password) authentication is supported for TLS. HTTP/2 support has been built-in. This curl supports Metalink (both version 3 and 4 (RFC 5854)), which describes mirrors and hashes. curl will use mirrors for failover if there are errors (such as the file or server not being available). FILES Default config file, see - K, --config for details. ENVIRONMENT The environment variables can be specified in lower case or upper case. The lower case version has precedence. httpproxy is an exception as it is only available in lower case. Using an environment variable to set the proxy has the same effect as using the --proxy option. Sets the proxy server to use for HTTP. Sets the proxy server to use for HTTPS. Sets the proxy server to use for url-protocol, where the protocol is a protocol that curl supports and as specified in a URL. FTP, FTPS, POP3, IMAP, SMTP, LDAP etc. Sets the proxy server to use if no protocol-specific proxy is set. NOPROXY ltcomma-separated list of hostsgt list of host names that shouldnt go through any proxy. If set to a asterisk only, it matches all hosts. PROXY PROTOCOL PREFIXES Since curl version 7.21.7, the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. If no protocol is specified in the proxy string or if the string doesnt match a supported one, the proxy will be treated as an HTTP proxy. The supported proxy protocol prefixes are as follows: Makes it the equivalent of --socks4 Makes it the equivalent of --socks4a Makes it the equivalent of --socks5 EXIT CODES There are a bunch of different error codes and their corresponding error messages that may appear during bad conditions. At the time of this writing, the exit codes are: Unsupported protocol. This build of curl has no support for this protocol. Failed to initialize. URL malformed. The syntax was not correct. A feature or option that was needed to perform the desired request was not enabled or was explicitly disabled at build-time. To make curl able to do this, you probably need another build of libcurl Couldnt resolve proxy. The given proxy host could not be resolved. Couldnt resolve host. The given remote host was not resolved. Failed to connect to host. Weird server reply. The server sent data curl couldnt parse. FTP access denied. The server denied login or denied access to the particular resource or directory you wanted to reach. Most often you tried to change to a directory that doesnt exist on the server. FTP weird PASS reply. Curl couldnt parse the reply sent to the PASS request. FTP weird PASV reply, Curl couldnt parse the reply sent to the PASV request. FTP weird 227 format. Curl couldnt parse the 227-line the server sent. FTP cant get host. Couldnt resolve the host IP we got in the 227-line. FTP couldnt set binary. Couldnt change transfer method to binary. Partial file. Only a part of the file was transferred. FTP couldnt download/access the given file, the RETR (or similar) command failed. FTP quote error. A quote command returned error from the server. HTTP page not retrieved. The requested url was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if - f, --fail is used. Write error. Curl couldnt write data to a local filesystem or similar. FTP couldnt STOR file. The server denied the STOR operation, used for FTP uploading. Read error. Various reading problems. Out of memory. A memory allocation request failed. Operation timeout. The specified time-out period was reached according to the conditions. FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead FTP couldnt use REST. The REST command failed. This command is used for resumed FTP transfers. HTTP range error. The range command didnt work. HTTP post error. Internal post-request generation error. SSL connect error. The SSL handshaking failed. FTP bad download resume. Couldnt continue an earlier aborted download. FILE couldnt read file. Failed to open the file. Permissions LDAP cannot bind. LDAP bind operation failed. LDAP search failed. Function not found. A required LDAP function was not found. Aborted by callback. An application told curl to abort the operation. Internal error. A function was called with a bad parameter. Interface error. A specified outgoing interface could not be used. Too many redirects. When following redirects, curl hit the maximum amount. Unknown option specified to libcurl. This indicates that you passed a weird option to curl that was passed on to libcurl and rejected. Read up in the manual Malformed telnet option. The peers SSL certificate or SSH MD5 fingerprint was not OK. The server didnt reply anything, which here is considered an error. SSL crypto engine not found. Cannot set SSL crypto engine as default. Failed sending network data. Failure in receiving network data. Problem with the local certificate. Couldnt use specified SSL cipher. Peer certificate cannot be authenticated with known CA certificates. Unrecognized transfer encoding. Invalid LDAP URL. Maximum file size exceeded. Requested FTP SSL level failed. Sending the data requires a rewind that failed. Failed to initialise SSL Engine. The user name, password, or similar was not accepted and curl failed to log in. File not found on TFTP server. Permission problem on TFTP server. Out of disk space on TFTP server. Illegal TFTP operation. Unknown TFTP transfer ID. File already exists (TFTP). No such user (TFTP). Character conversion failed. Character conversion functions required. Problem with reading the SSL CA cert (path access rights). The resource referenced in the URL does not exist. An unspecified error occurred during the SSH session. Failed to shut down the SSL connection. Could not load CRL file, missing or wrong format (added in 7.19.0). Issuer check failed (added in 7.19.0). The FTP PRET command failed RTSP: mismatch of CSeq numbers RTSP: mismatch of Session Identifiers unable to parse FTP file list FTP chunk callback reported error No connection available, the session will be queued SSL public key does not matched pinned public key More error codes will appear here in future releases. The existing ones are meant to never change. AUTHORS / CONTRIBUTORS Daniel Stenberg is the main author, but the whole list of contributors is found in the separate THANKS file. WWW FTP

No comments:

Post a Comment