Encabezado de solicitud HTTP This code demonstrates how to use HTTP request headers in IronPDF to render a PDF from an authenticated webpage. It begins by creating an instance of ChromePdfRenderer, which is responsible for converting web pages or HTML into PDFs. Next, it sets up HTTP request headers by assigning a dictionary to the HttpRequestHeaders property within RenderingOptions. In this case, an Authorization header is added with a Bearer token (test-token-123), which is commonly used for authentication in APIs. Once the headers are set, the RenderUrlAsPdf method is used to fetch and convert the webpage at https://httpbin.org/bearer into a PDF. This particular URL is a test API that requires Bearer authentication, making it a useful way to verify that the header is being correctly sent. Finally, the resulting PDF file is saved as "output.pdf" in the current directory. This approach is beneficial for generating PDFs from authenticated web pages, such as protected reports, dashboards, or API-generated content. Learn to Set HTTP Headers for PDF Rendering with IronPDF Ver en GitHub Código https://github.com/iron-software/IronPdf.Examples/tree/main/examples/http-request-header Descargar ZIP Tutorial Relacionado Guía de Cómo Hacer Relacionada Documentación de Clase Obtener Paquetes de Idiomas Descargar IronPDF DLL Reportar un problema en esta página ¿Listo para empezar? Nuget Descargas 16,154,058 | Versión: 2025.11 recién lanzado Descarga Gratis de NuGet Descargas totales: 16,154,058 Ver Licencias
Producto completamente funcional Obtén 30 días de producto completamente funcional.Instálalo y ejecútalo en minutos.
Soporte técnico 24/5 Acceso completo a nuestro equipo de soporte técnico durante tu prueba del producto
Producto completamente funcional Obtén 30 días de producto completamente funcional.Instálalo y ejecútalo en minutos.
Soporte técnico 24/5 Acceso completo a nuestro equipo de soporte técnico durante tu prueba del producto