Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
How to see non-body returns?

I'm using Postman to test Azure Function. For this code

context.res = {status: 200, body: "ok", txt: "hello"};

txt is nowhere to be seen. Anyway to check it or have to wrap it under body? enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

According to Azure Functions JavaScript developer guide the response doesn't contain the object you've specified:

The context.res (response) object has the following properties:

Property Description
body An object that contains the body of the response.
headers An object that contains the response headers.
isRaw Indicates that formatting is skipped for the response.
status The HTTP status code of the response.
cookies An array of HTTP cookie objects that are set in the response. An >HTTP cookie object has a name, value, and other cookie properties, such as >maxAge or sameSite.

I assume the property txt is not serialized to the response so I don't think you could access it from postman or other any other client.

If you want to return some data you should add it to the body:

context.res = {
    status: 200, 
    body: {
        "message": "ok", 
        "txt": "hello"
    }
};
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda