Souci curl fichier bash

Résolu/Fermé
cave2180 Messages postés 425 Date d'inscription mardi 24 août 2010 Statut Membre Dernière intervention 5 mars 2024 - 6 nov. 2019 à 23:28
cave2180 Messages postés 425 Date d'inscription mardi 24 août 2010 Statut Membre Dernière intervention 5 mars 2024 - 6 nov. 2019 à 23:50
Bonjour,

J'ai un souci avec la commande curl sous ubuntu
"curl: (3) Illegal characters found in URL"

Voici mon script :

#/bin/sh
ref='https://gestion.domain.fr/api/index.php/products/25'
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'APIKEY: cleapi' -d '{"price": "45"}' $ref

Pourtant mon url est bonne et sans caractère spéciaux.

Merci d'avance


Configuration: Windows / Firefox 70.0
A voir également:

2 réponses

jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 4 650
6 nov. 2019 à 23:43
Bonjour,

C'est la vraie url ?
Tu l'as testé (via postman par exemple) ?

essaye de faire ça avant l'appel curl
ref=${ref%$'\r'}



0
cave2180 Messages postés 425 Date d'inscription mardi 24 août 2010 Statut Membre Dernière intervention 5 mars 2024 6
6 nov. 2019 à 23:49
Pour l'url, juste le domaine, je la garde confidentielle.
La commande fonctionne dans le terminal mais pas en script...
J'ai ajouté la ligne et ça marche direct, j'ai complétement oublié le retour chario...
Merci :p
0