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

202
Visualizações
HTTP - PUT method returns status 200 but no data being put into the database

I am new and I'm lost as to why my PUT request did not inserting the data into the database.

    const orderId = JSON.stringify(1000 + Math.floor(Math.random() * 5000));

    await fetch(`http://0.0.0.0:9010/fdb/pos/collection/order/${orderId}`, {
        "method": "PUT",
        "headers": {
            "Content-Type": "application/json"
        },
        "body": JSON.stringify({
            merchantId,
            "_id": orderId,
            "lineItems": cartItems,
            "paymentIntent": paymentIntent.id,
            "status": "stripePendingPayment",
            "rejectedReason": "",
            "totalPrice": String(basketTotalPrice * 100),
            "updatedTs": new Date(),
            "createdTs": new Date()
        })
    }).then(r => console.log(r.status));

Log returned status 200 but no data. It works with POST method but not PUT. Does anyone have any idea as to why that is?

Any input is welcome with thanks in advance.

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

0

PUT is for updating the data, maybe this method just says you updated succesfully the content.

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