Outils pour utilisateurs

Outils du site


tech:notes_curl_wget

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:notes_curl_wget [2026/06/17 11:02] Jean-Baptistetech:notes_curl_wget [2026/09/10 14:52] (Version actuelle) Jean-Baptiste
Ligne 70: Ligne 70:
 Voir : Voir :
   * [Utiliser les REST API JSON avec cURL](http://www.zem.fr/rest-api-json-curl/)   * [Utiliser les REST API JSON avec cURL](http://www.zem.fr/rest-api-json-curl/)
-  * l'option `--globoff`+
  
 JSON JSON
Ligne 76: Ligne 76:
 curl -k https://aap-controller.local/api/v2/users/27/roles/ -X POST -u user:password --data-raw '{"id":534}' curl -k https://aap-controller.local/api/v2/users/27/roles/ -X POST -u user:password --data-raw '{"id":534}'
 ~~~ ~~~
 +
 +~~~bash
 +curl --globoff --request POST \
 +  --header "PRIVATE-TOKEN: <your_access_token>" \
 +  --url "https://gitlab.example.com/api/v4/projects/169/pipeline?ref=master&variables[0][key]=VAR1&variables[0][value]=hello&variables[1][key]=VAR2&variables[1][value]=world"
 +
 +curl --request POST \
 +  --header "PRIVATE-TOKEN: <your_access_token>" \
 +  --header "Content-Type: application/json" \
 +  --data '{ "ref": "master", "variables": [ {"key": "VAR1", "value": "hello"}, {"key": "VAR2", "value": "world"} ] }' \
 +  --url "https://gitlab.example.com/api/v4/projects/169/pipeline"
 +~~~
 +Source : https://docs.gitlab.com/api/rest/
 +
  
 Préciser le host sans modifier les /etc/hosts Préciser le host sans modifier les /etc/hosts
Ligne 172: Ligne 186:
 ~~~ ~~~
  
-Upload+ 
 + 
 +### Upload 
 ~~~bash ~~~bash
 curl -v -u admin:admin123 --upload-file pom.xml http://localhost:8081/repository/maven-releases/org/foo/1.0/foo-1.0.pom curl -v -u admin:admin123 --upload-file pom.xml http://localhost:8081/repository/maven-releases/org/foo/1.0/foo-1.0.pom
Ligne 223: Ligne 240:
 wget -O plop https://getsession.org/linux wget -O plop https://getsession.org/linux
 # Saving to: ‘plop' # Saving to: ‘plop'
 +~~~
 +
 +
 +### Fichier config .wgetrc
 +
 +`~/.wgetrc`
 +~~~bash
 +# https://www.gnu.org/software/wget/manual/html_node/Wgetrc-Commands.html
 +
 +# Set the certificate authority bundle file to file. The same as ‘--ca-certificate=file’.
 +ca_certificate = file
 +
 +# Set the directory used for certificate authorities. The same as ‘--ca-directory=directory’.
 +ca_directory = directory
 +
 +
 +header = Accept: */*
 +header = Accept-Language: en-US,en;q=0.8
 +header = Keep-Alive: 300
 +user_agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36
 +
 +# bind_address = 202.x.x.x
 +# referer = http://www.google.com
 ~~~ ~~~
  
Ligne 320: Ligne 360:
 TODO : equivalement pour Redhat avec `update-ca-trust` TODO : equivalement pour Redhat avec `update-ca-trust`
  
-`.curlrc`+`~/.curlrc`
 ~~~bash ~~~bash
 cacert=/home/jean/cert.pem cacert=/home/jean/cert.pem
 +~~~
 +
 +`~/.wgetrc`
 +~~~bash
 +# Set the certificate authority bundle file to file. The same as ‘--ca-certificate=file’.
 +ca_certificate = /home/jean/cert.pem
 +
 +# Set the directory used for certificate authorities. The same as ‘--ca-directory=directory’.
 +#ca_directory = directory
 ~~~ ~~~
  
Ligne 330: Ligne 379:
 insecure insecure
 ~~~ ~~~
 +
 +
 +
  
 https sous java https sous java
tech/notes_curl_wget.1781686962.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki