Hi Geoff, you always help me!
Thank you very much!
I’ll show you what happens:
1 - I have a TPS with data that is sent via cUrl with a POST by the magnificent cjson Mike
Code:
if Loc:Id=7
Loop i# = 1 to Records(Que:TPS)
Get(Que:TPS, i#)
If Qtps:tagIco=1
?PROGRESSpac{prop:progress} = ?PROGRESSpac{prop:progress} + 1
DISPLAY()
MCLI:COD_CLIN = Qtps:codMv
If Access:MCLI.Fetch(MCLI:Key_CodClin) = level:benign
arry:dadoCadastro[1] = EliminaOculto(MCLI:NOME)
arry:dadoCadastro[2] = EliminaOculto(MCLI:ENDERECO)
arry:dadoCadastro[3] = EliminaOculto(MCLI:BAIRRO)
arry:dadoCadastro[4] = EliminaOculto(MCLI:COMPLEMENTO)
arry:dadoCadastro[5] = EliminaOculto(MCLI:CIDADE)
arry:dadoCadastro[6] = EliminaOculto(MCLI:CEP)
arry:dadoCadastro[7] = Email_NComercial(MCLI:EMAIL)
arry:dadoCadastro[8] = Email_Comercial (MCLI:EMAIL)
arry:dadoCadastro[9] = EliminaAcentos_(MCLI:CELULAR)
arry:dadoCadastro[10]= EliminaAcentos_(MCLI:CNPJ)
arry:dadoCadastro[11]= EliminaAcentos_(MCLI:IE)
arry:dadoCadastro[12]= EliminaAcentos_(MCLI:REF)
arry:dadoCadastro[13]= EliminaAcentos_(MCLI:FONE)
arry:dadoCadastro[14]= EliminaAcentos_(MCLI:LOGIN)
Send:PostParams=|
'{{'&|
'"codmv":"'&MCLI:COD_CLIN&'",'&|
'"inicio":"'&format(MCLI:DATAS,@d10-)&'",'&|
'"razaosocial":"'&clip(json::ToUtf8(arry:dadoCadastro[1]))&'",'&|
'"nomefantasia":"'&clip(json::ToUtf8(arry:dadoCadastro[1]))&'",'&|
'"endereco":"'&clip(json::ToUtf8(arry:dadoCadastro[2]))&'",'&|
'"bairro":"'&clip(json::ToUtf8(arry:dadoCadastro[3]))&'",'&|
'"comp":"'&clip(json::ToUtf8(arry:dadoCadastro[4]))&'",'&|
'"cidade":"'&clip(json::ToUtf8(arry:dadoCadastro[5]))&'",'&|
'"uf":"'&clip(MCLI:UF)&'",'&|
'"cep":"'&clip(arry:dadoCadastro[6])&'",'&|
'"ref":"'&clip(json::ToUtf8(arry:dadoCadastro[12]))&'",'&|
'"fone":"'&clip( arry:dadoCadastro[13])&'",'&|
'"wsap":"'&clip(arry:dadoCadastro[9])&'",'&|
'"cnpj":"'&clip( arry:dadoCadastro[10])&'",'&|
'"ie":"'&clip(arry:dadoCadastro[11])&'",'&|
'"email":"'&clip(arry:dadoCadastro[7])&'",'&|
'"emailfin":"'&clip(arry:dadoCadastro[8])&'",'&|
'"cod_cid":"'&clip(MCLI:COD_CID)&'",'&|
'"dia_fatura":"'&clip(MCLI:DIA_FATURA)&'",'&|
'"login":"'& clip(arry:dadoCadastro[13])&'",'&|
'"senha":"'&clip(MCLI:SENHA)&'",'&|
'"logo":"'&clip(MCLI:Logo)&'",'&|
'"ativo":"'&clip(MCLI:Ativo)|
&'"}'
Loc:Id = 0
Send:CustomRequest ='GET'
Send:Url = clip(Glo:Url)&clip(Loc:cadastro)&'/'&Qtps:codMv
DO SendRequest!codMV
jRoot &= jParser.Parse(stReturn)
!=============== Se encontrar codMV
IF NOT jRoot &= NULL
!=============== Retorna o ID
Loc:Id = jRoot.GetValue('id')
MCLI:CodSite = Loc:Id
put(MCLI)
End
!=============== Se não encontrar codMV
If Loc:Id = 0
Send:CustomRequest='POST'
Send:Url = clip(Glo:Url)&clip(Loc:cadastro)
DO SendRequest
jRoot &= jParser.Parse(stReturn)
IF NOT jRoot &= NULL
MCLI:CodSite = jRoot.GetValue('id')
put(MCLI)
End
End
jRoot.Delete()
End
End
!
Where: EliminaOculto()
Data
str StringTheory
Code
str.SetValue(Par:Str)
str.Remove('<9>') !tab
str.Remove('<13>') !cr
str.Remove('\r')
str.Remove('?')
str.Remove('\n')
return(str.GetValue())
Note: json::ToUtf8()
does not cause these characters. I have already tested without it, so I can understand.
In fact, everything was on the same command line
json::ToUtf8(EliminaOculto())
the result is the same
The character was inserted in the field, when I open the registration screen, if I copy and paste it into a .TXT they also appear.
It looks like a TAB or enter…?
2 - I do the test by sending it to the website webhook.site, in this case the one selected from the list above:
Doc Vet
See the character appears in the email field
"email": "[email protected]\r,[email protected]",
Here we have the system screen:
And here is the data in the TPS…
and finally the TPS itself… lol
MCLI.zip (209,9,KB)
Note: The same happens with the characters I listed at the beginning of my question, that is, they do not appear in the field even with the TPS open but when pasted or sent…
I sent all this because sometimes there is missing data in my question, so I think everything is there.
I had already tried replacing it with eliminaOculto(), but I couldn’t, so I looked for help here on ClarionHub
Thank you very much in advance!!!