Changeset 11834


Ignore:
Timestamp:
Jul 26, 2011, 6:34:36 AM (13 years ago)
Author:
rvelices
Message:
  • ws accepts method name in GET paraeters even if http method is POST (easier to see in apache logs)
  • picture rating is done through POST and not GET
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_protocols/rest_handler.php

    r8728 r11834  
    4242      }
    4343    }
     44                if ( empty($method) && isset($_GET['method']) )
     45                {
     46                        $method = $_GET['method'];
     47                }
    4448
    4549    if ( empty($method) )
  • trunk/themes/default/js/rating.js

    r11827 r11834  
    6262                "pwg.images.rate", {image_id: gRatingOptions.image_id, rate: rateButton.initialRateValue } ,
    6363                {
     64                        method: "POST",
    6465                        onFailure: function(num, text) {
    6566                                alert(num + " " + text);
  • trunk/themes/default/js/scripts.js

    r8449 r11834  
    6161                this.xhr.onreadystatechange = pwgBind(this, this.onStateChange);
    6262
    63                 var url = this.urlRoot+"ws.php?format=json";
     63                var url = this.urlRoot+"ws.php?format=json&method="+method;
    6464
    65                 var body = "method="+method;
     65                var body = "";
    6666                if (parameters)
    6767                {
     
    7171                                {
    7272                                        for (var i=0; i<parameters[prop].length; i++)
    73                                                 body += "&"+prop+"[]="+encodeURIComponent(parameters[prop][i]);
     73                                                body += prop+"[]="+encodeURIComponent(parameters[prop][i])+"&";
    7474                                }
    7575                                else
    76                                         body += "&"+prop+"="+encodeURIComponent(parameters[prop]);
     76                                        body += prop+"="+encodeURIComponent(parameters[prop])+"&";
    7777                        }
    7878                }
Note: See TracChangeset for help on using the changeset viewer.