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

104
Views
How to set the multiple same name query in javascript ajax

I have python api which can get the multiple data in same query such as.

createdata?ob=120&st=cool&st=warm

It can get st as ["cool","warm"] in python.

st = request.query_params.getlist("st")

print(st) #["cool","warm"] get the data as array.

Now I want to do the same thing from ajax

I try this

$.ajax({
      type: "POST",
      url: "defapp/createdata",
      method: "GET",
      data: {"ob":130,"st":"warm","st":"cool"},
      contentType: "application/json",

and this.

$.ajax({
      type: "POST",
      url: "defapp/createdata",
      method: "GET",
      data: {"ob":130,"st":["warm","cool"]},
      contentType: "application/json",

However former one get ["cool"] as st

later one get [] as st.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It's don't work,because you api not recive a data body,but it recive a params value. You can changed to these below.

$.ajax({
      type: "POST",
      url: "defapp/createdata?ob=120&st=cool&st=warm",
      method: "GET",
      data: {},
      contentType: "application/json",

I hope is can work in your case.

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!