PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → Send Imagem by HTTPCreateForm sem serializar e sem fazer uso de encode base 64
Send Imagem by HTTPCreateForm sem serializar e sem fazer uso de encode base 64
Débuté par Boller, 08 juin 2022 20:24 - Aucune réponse
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 08 juin 2022 - 20:24
Prezados,

Retificando o exemplo de imagem
ficou assim usando HTTPCreateForm muito mais simples:

lIdForm is string = "form-data"
HTTPTimeOut(60s)
HTTPCreateForm(lIdForm)
HTTPAddFile(lIdForm, "file", gsLastCapturePath)
IF HTTPSendForm(lIdForm, sURL, httpPost, "AGENT") THEN
sRetorno is JSON = HTTPGetResult()
END

Retorna isso aqui:
{
"eyes":
{
"ratio":1.060935286195,
"response":"olho esquerdo > olho direito por 0.06%"
},
"eyebrows":
{
"ratio":1.060935286195,
"response":"olho esquerdo > olho direito por 0.06%",
"muscles":
[

],
"points":
[

]
},
"left_eyebrow":
[

],
"right_eyebrow":
{
"muscles":
[
[
"Pr\u00f3cero",
8,
5
],
[
"Corrugador (e)",
336,
5
],
[
"Corrugador (e)",
468,
5
]
],
"points":
[
[
8,
5
],
[
336,
5
],
[
468,
5
]
]
},
"horizontal_proportion":
[
"61",
"89",
"100",
"84",
"54"
],
"vertical_proportion":
{
"muscles":
[

],
"firstThird":
[
376.2605480249,
1
],
"secondThird":
[
476.3402145526,
1.265985012388
],
"thirdThird":
[
654.4043092768,
1.739231797519
]
},
"mouth":
{
"ratio":0.006996088402819,
"response":"boca esquerdo < boca direito por 0.01%"
},
"width_height":
{
"ratio":0.9830342433159
},
"nose_width":
{
"ratio":0.8700248030915
},
"lips_proportion":
[
59.07622195097,
95.08417323614,
1.609516825823
],
"mouth_width_proportion":
[
390.1550973651,
888.6894845783,
401.280450558,
319.189598828
],
"thirds_middle_horizontal_proportion":
[
978.8176541113,
1046.883470115,
1033.853471242
],
"id":"uO3y04xfERN7lHludC8Q",
"images":"I9Yd6tuAs0C9iC0IA7RK.jpg,horizontal_proportion_0.png,nose_0.png,thirds_middle_0.png,annotated_image0.png,left_eyebrow_0.jpg,nose_symmetry_0.png,eyebrows_0.jpg,lips_proportion_0.png,proportion_0.png, eyes_0.png,mouth_proportion_0.png"
}

MUITO OBRIGADO AO FABIANO QUE PASSOU GENTILMENTE ESSE EXEMPLO PARA A COMUNIDADE!

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/