Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
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 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!