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

126
Visualizações
How to pass url dynamically to rest api?

I need to pass the get api urls for fetch the data from one application to another application. I have temporary solution as the url details in queryParams and use it in another application. Is there any professional way to implement for build url with dynamically?

In my first application i have build the url as below

async buildUrl(applicationId, getUrl) {
        let url = this.filterBaseurl + `datafilter/get-filter-utility?entityId=${applicationId}&connectorName=${this.connectorName}&entityName=${this.entityName}&getUrl=${getUrl}`
        return url
    }

example result of above function is

${baseUrl}/datafilter/get-filter-utility?entityId=12345678&connectorName=greenhouse&entityName=engagement-request&getUrl=jobs

in my another application i have calling the required api url

let queryparams = req.queryParams
let url = ${queryparams.getUrl}/{queryparams.entityId}
let response = await this.restProvider.get(url)

the way i have implement with queryParams is unprofessional, is there any better way to build the api url dynamically. one difficulty is i shouldn't call second application's api endpoint from first application.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Something like this?

var x1 = new URL("https://example.org")
x1.searchParams.append("x", "y")
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