<!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8">
                <title>Jaggery - Delicious Javascript</title>
                <meta name="description" content="">
                    <meta name="author" content="">

                        <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
                        <!--[if lt IE 9]>
                        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
                        <![endif]-->

                        <!-- Le styles -->
                        <link href="../css/bootstrap.css" rel="stylesheet">
                            <style type="text/css">
                            body {
                                padding-top: 60px;
                                }
                            </style>
                            <link href="../css/prettify.css" rel="stylesheet">
                                <!-- Le fav and touch icons -->
                                <link rel="shortcut icon" href="../images/favicon.ico">
                                    <link rel="apple-touch-icon" href="../images/apple-touch-icon.png">
                                        <link rel="apple-touch-icon" sizes="72x72"
                                        href="../images/apple-touch-icon-72x72.png">
                                            <link rel="apple-touch-icon" sizes="114x114"
                                            href="../images/apple-touch-icon-114x114.png">
                                            </head>

                                            <body>

                                                <%
                                                include('/includes/topnavi.jag');
%>

<div class="container-fluid" style="width: 960px; margin: auto;">
<div class="row">
    <div class="span16">
        <div class="page-header">
            <h1  id="top">
                Documentation
                <small>API documentation for Jaggery.js</small>
            </h1>
        </div>
    </div>
</div>

<div class="row">
<div class="span4">
    <div class="well">
        <%
        include('/includes/navi.jag');
        %>

    </div>

</div>
<div class="span12">
<div class="content" id="post" name="post">
<h3>post()</h3>

<pre class="prettyprint linenums">
&lt%
var version = post("http://stratoslive.wso2.com/services/Version");
print(version);
%&gt
</pre>
<%

var emailCode = '&lt%'
+ '\n var version = post("http://stratoslive.wso2.com/services/Version");'
+ '\n print(version);'
+ '\n %&gt';

var codeSnip = encodeURIComponent(emailCode);
var urlString = '../tryitframe.jag?code='+codeSnip;

include('/includes/tryit_but.jag');
%>

    <div id="pageLinks">
        <a class="navilink" href="#overview">Overview</a>
        <%if(hasParams) {%>
        <a class="navilink" href="#parameters">Parameters</a>
        <%}%>
        <%if(hasRets) {%>
        <a class="navilink" href="#returnVals">Return values</a>
        <%}%>
    </div>

<section id="overview">

<h4>Overview</h4>
<p class="description"><code>post()</code> is a wrapper for XMLHTTPRequest's POST method.
using <code>post()</code> you can avoid the use of XHR and shorten the serverside POST requests</p>
    <pre class="prettyprint">post(url[, data][, type][, headers][, success(data, xhr)])</pre>
    <pre class="prettyprint">var res = post(url[, data][, type][, headers])</pre>
</section>

    <section id="parameters">
        <h4>Parameters</h4>
        <table class="clsStd operations-table">

            <tbody>

            <tr>

                <th>Parameter</th>
                <th>Type</th>
                <th>Description</th>

            </tr>

            <tr>
                <td><code>url</code></td>
                <td>String</td>
                <td>The URL which HTTP POST is performed </td>
            </tr>
            <tr>
                <td><code>data</code></td>
                <td>Object</td>
                <td>Request parameters</td>
            </tr>
            <tr>
                <td><code>type</code></td>
                <td>String</td>
                <td>The type, which the response is expected</td>
            </tr>
            <tr>
                <td><code>headers</code></td>
                <td>String</td>
                <td>Optional HTTP headers</td>
            </tr>
            <tr>
                <td><code>success(data:Object,<br/> xhr:Object)</code></td>
                <td>function</td>
                <td>On success callback</td>
            </tr>
            </tbody>
        </table>
    </section>


    <section id="returnVals">
        <h4>Return values</h4>
        <table class="clsStd operations-table">
            <tbody>
            <tr>
                <th>Value</th>
                <th>Type</th>
                <th>Description</th>
            </tr>
            <tr>
                <td><code>data</code></td><td>Object</td><td>Contains the return data of the HTTP POST request</td>
            </tr><tr>
                <td><code>xhr</code></td><td>Object</td><td>Contains an instance of XMLHTTPRequest</td>
            </tr>
            </tbody>
        </table>
    </section>
</div>
<!-- /post div -->
<br>
<br>
</div>

</div>
<%
include('/includes/footerfunc.jag');
%>


</div>
<!-- /container -->
<%
include('/includes/scripts.jag')
%>

	<script>

		$(document).ready(function(){
        $('#post').toggleClass('active')
		$('#docs').addClass('active')
        });




	</script>
</body>
</html>