Salut J'ai généré une URL signée pour télécharger sur google cloud seau, mais quand je tente de mettre, je reçois SignatureDoesNotMatch, bizarrement seulement avec PostMan. Quand j'essaye même Url, queryParams, en-têtes en Python, j'ai pu télécharger très bien.Google Cloud signé url "SignatureDoesNotMatch" lors de l'utilisation de PostMan mais fonctionne très bien avec Python
Voici la demande que j'ai essayé dans PostMan
url: https://storage.googleapis.com/ ****-171020.appspot.com/[email protected]****-171020.iam.gserviceaccount.com expires = Signature = tlcHVRwbvMSxaIB6oO/TDXRDczXGFSE6ZXHmZbtCUMhjpos36/1KdKV7Lbmm7XtKsq42SFNksUIZLplyAMpkG8aMBuydeoJd + kvebLxK2k + AX8Xr2VVf5Aq/vVJrPGGYGD0iEN + bY264NIFbyJnlm0pthCVGtB5YqZJadCFDwPFWqi04312Jzzen1CXDY + + saY0BabmXaZeCzINz7kV aq0AJoS8taW0uqboYc1o4gCA6OPAswMr1E840a + II4HqkeOWcv7PiHEPdw/sgH3PR + TkGmjTAd9f8H6zJIFaT8DLbtsl7t3iAUM7Fvdtc9pGQt6KT0qUm9z3XfPEjP8OsTA ==
Tête: Content-MD5: 7Qdih1MuhjZehB6Sv8UNjA == Content-Type: text/plain
Voici le programme Python qui fonctionne:
import requests
url = "https://storage.googleapis.com/****-171020.appspot.com/swift.txt"
querystring = {'GoogleAccessId':'[email protected]****-171020.iam.gserviceaccount.com', 'Expires':'1503755879', 'Signature':'tlcHVRwbvMSxaIB6oO/TDXRDczXGFSE6ZXHmZbtCUMhjpos36/1KdKV7Lbmm7XtKsq42SFNksUIZLplyAMpkG8aMBuydeoJd+kvebLxK2k+AX8Xr2VVf5Aq/vVJrPGGYGD0iEN+bY264NIFbyJnlm0pthCVGtB5YqZJadCFDwPFWqi04312Jzzen1CXDY+saY0BabmXaZeCzINz7kV+aq0AJoS8taW0uqboYc1o4gCA6OPAswMr1E840a+II4HqkeOWcv7PiHEPdw/sgH3PR+TkGmjTAd9f8H6zJIFaT8DLbtsl7t3iAUM7Fvdtc9pGQt6KT0qUm9z3XfPEjP8OsTA=='}
payload = "Hello World!"
headers = {'Content-MD5': '7Qdih1MuhjZehB6Sv8UNjA==', 'Content-Type':'text/plain'}
response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
print(response.text)
S'il vous plaît me aider à comprendre ce qui se passe ici. Merci!
Je crois que votre problème est de savoir comment vous avez défini vos en-têtes dans le facteur. Essayez de remplacer "clé" et "valeur" avec les clés et les valeurs réelles. Ex: {"Content-MD5": "7Qdih1MuhjZehB6Sv8UNjA =="} au lieu de {"key": "Content-MD5" ...} – AllenMoh
@AllenMoh C'est juste la façon dont le facteur a été ajouté au presse-papiers quand j'ai essayé de le copier, édité pour éviter confusion. – Aster