asp.net mvc 5 - Encrypt jquery/ajax call when posting -


i have jquery ajax method listen onlick of button, when clicked makes call controller , passes in parameters goes on call database.

when click button see following in developer tool bar console.

http://localhost:37495/user/setprofilepicture?pictureid=2&_=1434199801182 

is there way can encrypt that? un-readable, on forum mentioned writing special route particular situation can't seem find on web.

update

this code looks have been looking @ following example: encode/decode url javascript

  $('.profilebutton').on("click", function () {         var $this = $(this);          var url = '/user/setprofilepicture?pictureid=' +  $(this).attr("data-id") + '';          $.ajax({             url: encodeuricomponent(url),             //data: { "pictureid": $this.attr("data-id") },             cache: false,             type: "get",             success: function (result) {                 if (result.success) {                     $("div.thumbnail").removeclass("photoactive");                     $this.closest("div.thumbnail").addclass("photoactive");                 }             },             error: function (result) {                 alert("sorry, can not set profile picture @ time");             }         });         return false;     }); 

but error:

"networkerror: 400 bad request - http://localhost:37495/user/%2fuser%2fsetprofilepicture%3fpictureid%3d3?_=1434452450966"

you can encrypt contents, not url. re-write ajax call have of url parameters part of body. body can encrypted.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -