GET/POST + JSON/JSONP

nickvidal - November 6, 2009 - 00:39
Project:JSON server
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:ilo
Status:needs work
Description

Hi Dmitrig01,

I'm trying to contact you again. Please don't ignore.

As discussed on email, these are simple changes that do not affect the basic structure of the module.

It requires only two changes:

1) Replaced all $_POST for $_REQUEST.

2) Changed the code so that if a callback is set, it will return a json-p.

$callback = $_REQUEST['callback'];

if ($callback) {
header("Content-type: text/javascript");
return $callback ."(". $json .");";
} else {
header("Content-type: application/json");
return $json;
}

Kind regards,
Nick

#1

ilo - November 6, 2009 - 01:16
Assigned to:Anonymous» ilo
Status:active» needs work

Lets see how this works with #598358: JSON server now allows for JSON/P callback. If you have a patch probably this would go in faster.

#2

ilo - November 6, 2009 - 01:18

Andremolnar, any direction on this proposal? can we merge both issues and get this feature working?

 
 

Drupal is a registered trademark of Dries Buytaert.