TIPS - Curl : Différence entre versions

De PedroWiki
(Page créée avec « = Introduction = This article lists a few ways to call curl, depending on your need. = Curl calls = == Fake the DNS resolution == Use case: * your website is behind a... »)
 
Ligne 12 : Ligne 12 :
  
 
  curl --resolv <my.domain>:443:<IP> https://<my.domain>[/<my_uri>]
 
  curl --resolv <my.domain>:443:<IP> https://<my.domain>[/<my_uri>]
 +
 +
== Add a request header ==
 +
 +
Curl option: -H
 +
 +
Sample call:
 +
 +
curl -IL -H '<header name>:<header value>' https://<URL to curl>

Version du 25 septembre 2023 à 14:24

Introduction

This article lists a few ways to call curl, depending on your need.

Curl calls

Fake the DNS resolution

Use case:

  • your website is behind a WAF and the FQDN resolves to it instead of the web server directly (the origin).
  • your website is behind a reverse proxy, but you want to access the underlying web service with appropriate host header in your request.
curl --resolv <my.domain>:443:<IP> https://<my.domain>[/<my_uri>]

Add a request header

Curl option: -H

Sample call:

curl -IL -H '<header name>:<header value>' https://<URL to curl>