Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

267
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda