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

144
Views
I am getting bad request error in my ajax post response

I am trying to append my ajax response into data table. I am using ajax inside the Data table.

 <script>
    $(function () {
        $('#dataTable').DataTable({
              processing: true,
              serverSide: true,
             "ajax": {
    "url": "https://2057-185-202-239-227.ngrok.io/employee/employeesByCompany",
    "contentType": "application/json",
    "type": "POST",
    "dataSrc" : "doc",
    "data": JSON.stringify({"company" : "6249fdf91399dc7a14173dcd"})
  },
            columns: [
                { doc: 'createdDate' },
                { doc: 'CNIC' },
                { doc: 'employeeID' },
                { doc: 'fName' },
                { doc: 'fatherName' }
            ],
            "columnDefs": [{ /* default values for columns */
                "defaultContent": "-",
                "targets": "_all"
            }],
        });
    }); 
</script>

the above is my ajax request where I am Posting company id to my APIto retrieve data from API but getting error

This is the error I am getting in my console tab developer options: POST https://2057-185-202-239-227.ngrok.io/employee/employeesByCompany 400

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