The default data format for Amfphp is AMF. However Amfphp looks at the content type header to see if the request should be handled differently. For example if no content type is detected, the service browser plugin assumes that the request is coming from a Web browser and handles the request instead. There are 2 ways to inform Amfphp about the content type:
- using the Content-Type HTTP header. See the section « 14.17 Content-Type » in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for details. Sometimes this fails because of server or client configuration and limitations, which is why there is the alternative below.
- passing the content type in the URL. For example http://youserver/Amfphp/?contentType=application/json will cause the JSON plugin to handle the request.
Try whatever method works best for you. The examples use the second method as it is easier to read.