I need to pass JSON data to a server. Data looks like this:
{"method":"like","data":{"type":1,"id":123}}
I need it to be done automaticaly, if I would use a form it can be done like this:
<script>
jQuery(document).ready(function(){
jQuery("#form").submit();
});
</script>
But I need to pass data using $_POST in that exact format. How can this be done?