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

222
Visualizações
Post Request rejected with "Missing body content" error during Fetch

I am sending a Post request, with JavaScript Fetch method. The post attempts to create a Microsoft Teams chat message, via the Microsoft Graph Teams API. However, the server rejects the post request, with the message "missing body content". The payload shows the message body is being sent (Please see screenshot). It appears that the server is rejecting my Post request because it can not parse the body, which is in json format. Can anyone advise how I fix this Fetch issue? I've attached a code snippet for your review.

const data = {content: 'Hello Word'};
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer '+response.accessToken,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(data),
};

fetch(endpoint, options)
    .then((response)=>{
      const data = response.json();
      console.log("RESPONSE1:", data);
      return data;
    })
    .then((data)=>{
      console.log("RESPONSE2:", data);
      callback(data, endpoint);
    })
    .catch((error) => console.log("PUSHMSGRAPH-Error:", error));

Post Request

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

0

Try using the API and post it from the reference page with this API

POST /teams/{team-id}/channels/{channel-id}/messages

const teamId = '5834e4c1-2897-4cc3-b21900b56';
const threadid = '19:1df3a1d...@thread.tacv2';

const options = {
  authProvider,
};

const client = Client.init(options);

const chatMessage = {
  body: {
    content: 'Hello World'
  }
};


await client.api('/teams/' + teamId + '/channels/' + threadid + '/messages')
  .post(chatMessage);

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