endpoint java script com caracter especial
26/08/2022
0
var headers = {
''Authorization'': ''Basic '' + new Buffer(_config.user + ":" + _config.password).toString("base64"),
''Convenio'': mMetadata.getValue("terminalClientId",metadata),
''Origem'': _config.origem,
''Token'': mMetadata.getValue("token",metadata),
''Chave-Acesso'' : _config.chaveacesso
};
assim retorna status 400 Bad Request, se eu envio via postman funciona e retorna 200
ja verifiquei, os parametros estao ok, a url tambem
percebi que no console.log muda por causa do traço, ele ta colocando uma aspas simples no content-type e no chave-acesso, por causa do traço, se eu retirar o traço, dae nao aparece a aspas simples, mas retorna outro erro, pq tenho que mandar a tag chave-Acesso
options.headers {
Authorization: ''Basic YXRjYWJsdG90ZW06SW5pY2lvQVVUMTIzNA=='',
Convenio: ''AT0010003'',
Origem: ''AUT'',
Token: ''eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcInByb3RvY29sb1wiOlwiMDE0MzMxNzgwMjZcIn0iLCJpc3MiOiJhdXRoMCIsImV4cCI6MTY2MTU0MTg4OH0.20WT5DoKNnjHyqtYdlBkh0w1a4nroa1XREC-hR34JtA'',
''Content-Type'': ''application/json'',
''Chave-Acesso'': ''eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcImF1eFwiOlwiQ0FSTUVSSUFcIn0iLCJpc3MiOiJhdXRoMCJ9.Er2HlUBOeL5VqejUxXbtbIYsrciroEstslHEjN5zPpw''
}
Marcos Corso
Posts
30/08/2022
Stella Oliveira
curl --location --request GET '''' \\\\ --header ''Authorization: Basic YXRjYWJsdG90ZW06SW5pY2lvQVVUMTIzNA=='' \\\\ --header ''Convenio: AT0010003'' \\\\ --header ''Origem: AUT'' \\\\ --header ''Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcInByb3RvY29sb1wiOlwiMDE0MzMxNzgwMjZcIn0iLCJpc3MiOiJhdXRoMCIsImV4cCI6MTY2MTU0MTg4OH0.20WT5DoKNnjHyqtYdlBkh0w1a4nroa1XREC-hR34JtA''\\\\'''''' \\\\ --header ''Content-Type: application/json'' \\\\ --header ''Chave-Acesso''\\\\'''': eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcImF1eFwiOlwiQ0FSTUVSSUFcIn0iLCJpc3MiOiJhdXRoMCJ9.Er2HlUBOeL5VqejUxXbtbIYsrciroEstslHEjN5zPpw''\\\\''''''
30/08/2022
Stella Oliveira
--header 'Authorization: Basic YXRjYWJsdG90ZW06SW5pY2lvQVVUMTIzNA==' \\
--header 'Convenio: AT0010003' \\
--header 'Origem: AUT' \\
--header 'Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcInByb3RvY29sb1wiOlwiMDE0MzMxNzgwMjZcIn0iLCJpc3MiOiJhdXRoMCIsImV4cCI6MTY2MTU0MTg4OH0.20WT5DoKNnjHyqtYdlBkh0w1a4nroa1XREC-hR34JtA'\\''' \\
--header 'Content-Type: application/json' \\
--header 'Chave-Acesso: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcImF1eFwiOlwiQ0FSTUVSSUFcIn0iLCJpc3MiOiJhdXRoMCJ9.Er2HlUBOeL5VqejUxXbtbIYsrciroEstslHEjN5zPpw'\\'''
31/08/2022
Marcos Corso
--header 'Authorization: Basic YXRjYWJsdG90ZW06SW5pY2lvQVVUMTIzNA==' \\\\
--header 'Convenio: AT0010003' \\\\
--header 'Origem: AUT' \\\\
--header 'Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcInByb3RvY29sb1wiOlwiMDE0MzMxNzgwMjZcIn0iLCJpc3MiOiJhdXRoMCIsImV4cCI6MTY2MTU0MTg4OH0.20WT5DoKNnjHyqtYdlBkh0w1a4nroa1XREC-hR34JtA'\\\\''' \\\\
--header 'Content-Type: application/json' \\\\
--header 'Chave-Acesso: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJ1Y1wiOlwiMzY4NjA4MjRcIixcImF1eFwiOlwiQ0FSTUVSSUFcIn0iLCJpc3MiOiJhdXRoMCJ9.Er2HlUBOeL5VqejUxXbtbIYsrciroEstslHEjN5zPpw'\\\\'''
não entendi
Clique aqui para fazer login e interagir na Comunidade :)