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

260
Views
Why request to server parameter 'occupation=01%02' is work normally but 'occupation=01%2C02' or 'occupation=01&occupation=02' is get error?

When using the API, the parameter requested to the server does not work properly. 'occupation=01%02' works fine (change url directly in internet browser), but it throws an error when 'occupation=01%2C02'(,) or 'occupation=01&occupation=02'.

This error occurs when requesting to the server with multiple values ​​from the checkbox.

What is the problem? Is it an encoding problem? If I'm wrong, where would I go wrong?

I used html5 client and receive 10 from the server and paging them

in java:

uri = new URIBuilder()
                .setScheme("http")
                .setHost("openapi.work.go.kr")
                .setPath("/opi/opi/opia/wantedApi.do")
                .setParameter("returnType", "xml")
                .setParameter("startPage", requestVo.getStartPage())
                .setParameter("callTp", "L")
                .setParameter("region", "30200")
                .setParameter("occupation", requestVo.getOccupation())
                .setParameter("keyword", requestVo.getKeyword())
                .setParameter("authKey", requestVo.getKey())
                .build();

in jsp :checkbox id is occupation_chbox and I put the value in

<input type="hidden" name="startPage" value="1">

using js

function jobsubmit(){
    var form = document.getElementById("requestForm")
    var occ = checkOcc();
    $("#occupation").val(occ);
    console.log($("#occupation").val());
    form.submit();
}

function checkOcc(){
    var chk_arr = [];
    $("input[id='occupation_chbox']:checked").each(function(){
        var chkBox = $(this).val();
        chk_arr.push(chkBox);
    })
    console.log(chk_arr);

    var occ="";
    for(i = 0; i<chk_arr.length; i++){
   
        occ += (i < chk_arr.length - 1) ? chk_arr[i] + "," : chk_arr[i]
    }
    console.log(occ);

    return occ;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I solved this problem by changing the delimiter from ',' to '|'.

occ += (i < chk_arr.length - 1) ? chk_arr[i] + "|" : chk_arr[i]
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!