-1

Então tenho o seguinte JSON :

var json = {
  'cache-control': 'no-store, must-revalidate, max-age=0',
  'content-length': '12747',
  'content-type': 'text/html;charset=utf-8',
  'content-language': 'pt-br',
  'set-cookie': [
    'ApplicationGatewayAffinity05CORS=97a3c470e904c1e72a708e84142b5859; Path=/; SameSite=None; Secure',
    'ApplicationGatewayAffinity05=97a3c470e904c1e72a708e84142b5859; Path=/']
}

Como faço pra selecionar o set-cookie? Tentei o var cookie = json.set-cookie mas não funciona.

1
  • 3
    json['set-cookie']
    – Andre
    31/05/2020 às 0:14

1 Resposta 1

0

Atributos de um Objeto literal (JSON) podem ser acessados como chaves em um array.

const cookie = json['set-cookie'];

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .