Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

272
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda