Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

387
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!