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

307
Visualizações
The parameter __metadata does not exist in method GetByTitle when I'm trying to insert a new row to a SharePoint list

I am working on an application in React.js, which sends data from an HTML form to a SharePoint list using the POST method. Unfortunately, I get error "The parameter __metadata does not exist in method GetByTitle". Already checked this thread, but didn't help.

Here's my code:

send = () => {
    const url = "https:/myspsiteaddress/_api/web/lists/getbytitle(%27SkillsList%27)"

    var newItem = {
      '__metadata': {'type': "SP.Data.SkillsListListItem"},
        Title: 'Sample Title',
        Choice2: this.state.screen1Skills
      }

      $.ajax({
        url: "https://myspsiteaddress/_api/contextinfo",
        type: "POST",
        headers: {
          "accept": "application/json;odata=verbose",            
        },

        success: function(_data) {
          var postDigest = _data.d.GetContextWebInformation.FormDigestValue ? _data.d.GetContextWebInformation.FormDigestValue : $("#__REQUESTDIGEST").val();          

          $.ajax({
            url: "https://myspsiteaddress/_api/web/lists/getbytitle(%27SkillsList%27)",
            type: "POST",
            contentType: "application/json;odata=verbose",
            data: JSON.stringify(newItem),
            headers: {
                "Accept": "application/json;odata=verbose",
                'Access-Control-Allow-Origin': '*',
                "X-RequestDigest": postDigest,
                "X-HTTP-Method": "POST",
                "If-Match": "*"                 
           },               

            success: console.log('success'),
            error: function (error) {
              alert(JSON.stringify(error))}
          });          

        },

        error: function (err) {
          alert(JSON.stringify(err));
        }

      });
  }
about 4 years ago · Juan Pablo Isaza
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