Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

605
Vistas
Azure Data Tables JS SDK - how to set Request Header - contentType: application/json;odata=nometadata

Question: is there a way to set the request header item contentType: application/json;odata=nometadata prior to a call to TableClient.listEntities. Objective: to receive data payloads uncluttered with odata metadata.

I am using the Azure Data Tables JavaScript API, and would like to specify request header item as follows:-

contentType: application/json;odata=nometadata

I've looked through the documentation (https://docs.microsoft.com/en-us/javascript/api/@azure/data-tables/?view=azure-node-latest) and there are some methods which facilitate changes to the request header, e.g. TableInsertEntityHeaders interface includes a property 'contentType'.

the TableClient.listEntities method includes a parameter (options?: ListTableEntitiesOptions) which does not include header access. So, as far as I can see, there is no obvious functionality supplied by the API to change the Request Header.

thank you

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can specify this in format parameter in the query options. Please see the sample code below:

const { TableClient, AzureNamedKeyCredential } = require("@azure/data-tables");

const account = "account-name";
const accountKey = "account-key";
const tableName = "table-name";

const credential = new AzureNamedKeyCredential(account, accountKey);
const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);

async function main() {
  let entitiesIter = client.listEntities({
    queryOptions: {
      format: "application/json;odata=nometadata"
    }
  });
  let i = 1;
  for await (const entity of entitiesIter) {
    console.log(`Entity ${i}:`);
    console.log(entity);
    console.log('==================');
    i++;
  }
}

main();
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda