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

390
Vistas
Making a GET request that uses POST method - Javascript to C# API

I have a situation where I'm required to encrypt data in flight from a JavaScript based application (Chrome Extension popup.html) to an API hosted in a .NET MVC website(C#).

I can run the request as a GET but project requirements make it necessary to encrypt the parameters I'm sending. For example if I was searching for all people named 'John' I need to encrypt 'John' in flight.

My JavaScript application is using jsencrypt and a RSA (public) key provided by the website in other APIs that work quite well to return counts.

If my GET version of the link looks like this:

<span class="person" id="personList">Person: <a href="' + url + 'Persons/Search?find=' + search + '" target="_blank">'+ query +'</a></span>

On the .NET website end, this request is processed into a view that generates a table using a database call. As you can see in my link the results are populated onto a new tab in the browser.

How would you recommend changing it to calling a POST method and getting the same result as a GET?

EDIT I tried to employ an AJAX function to make the POST but it doesn't like the data element:

                event.preventDefault();
                $.ajax({
                url: repurl + 'Persons/Search',
                timeout:30000,
                type: "POST",
                data: {body: encryptedmsg},
                success : function(msg) {
     
                     if (msg.ws_resultat.result_ok == true)
                     {
                        alert('ok');    
                     }
                     else 
                     {
                       alert('some thing went wrong, plz try again');
                     }
                 }
     
                });
});```
about 4 years ago · Juan Pablo Isaza
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