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

110
Visualizações
Query string sending only half URL to controller

I have a URL that I am trying to pass as a query string to the controller. But When I do that, I get only half URL. However, console.log prints the whole URL.

export async function sendNotification(PlanId: string, URL: string) {
    console.log("Service URL : - ", URL);
    let url = HttpClient.buildUrl(`api/smsNotification/${PlanId}?URL=${URL}`);
    return await HttpClient.get(url);
}

[HttpGet("Notification/{PlanId}")]
        [ValidateModelState]
        public async Task<IActionResult> SendNotification(Guid PlanId, string URL)
        {
                return NoContent();
        }
console log prints this URL

https://chats.landbot.io/v3/index.html?name=Sys+Admin&planid=a7f8&environment=dev&stack=dev

But at controller, I get this URL

https://chats.landbot.io/v3/index.html?name=Sys Admin

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

0

Query string parameters are separated by & symbol. As you can see, this is exactly where your URL is cut off. For the controller to get full URL, you need to encode it before passing as query parameter:

encodeURIComponent(url)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent

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