Book Image

Learning Alfresco Web Scripts

By : Ramesh Chauhan
Book Image

Learning Alfresco Web Scripts

By: Ramesh Chauhan

Overview of this book

Table of Contents (18 chapters)
Learning Alfresco Web Scripts
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Dealing with client limitations


One of the limitations would be that not all clients can make all the HTTP calls. It might be possible that it is only restricted to GET or POST calls. The web script framework in Alfresco provides a way to tunnel an HTTP method using a POST method and using it, you can invoke other HTTP method calls. This can be done using the X-HTTP-Method-Override header in the HTTP request with the value as the method name, for example, GET. An alternative way is to specify alf_method as a query string parameter.

Another client limitation could be that not all clients can gracefully handle HTTP codes for non-success. In such cases, there is a mechanism to force the HTTP response to specify success in the response header. The response body still represents the content as if a non-success status has been received, which allows the client to know about the error code or message provided by the web script, if any. In order to be able to gracefully handle the HTTP code for non...