0

I'm creating an open source API using php and allowing the public to use it via jQuery AJAX GET.

I just need to know how I can make this secure.

For example, the users can call my php api on my server using jquery ajax like this:

var url = "http://mywebsite.com/api.php";
var variable = $("#variable").val();
$.ajax({
  type: "GET",
  url: url,
  data: 'variable='+variable,
  cache: false,
  success: function(data){
     $("#resultarea").html('' + data + '');
  }
});

is there anything I need to do/Know for securing this API before presenting it to the public?

Any advise would be appreciated.

1 Answer 1

1

You can encrypt your data before sending like answered here .. Best way to guarantee correct Ajax calls parameter values

Hope it helps :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.