You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by he...@apache.org on 2012/10/31 17:18:43 UTC

svn commit: r1404225 - /airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_jason.html

Author: heshan
Date: Wed Oct 31 16:18:42 2012
New Revision: 1404225

URL: http://svn.apache.org/viewvc?rev=1404225&view=rev
Log:
Constructing a jason message.

Modified:
    airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_jason.html

Modified: airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_jason.html
URL: http://svn.apache.org/viewvc/airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_jason.html?rev=1404225&r1=1404224&r2=1404225&view=diff
==============================================================================
--- airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_jason.html (original)
+++ airavata/sandbox/client-api-demo/src/main/webapp/x_app_descriptor_save_jason.html Wed Oct 31 16:18:42 2012
@@ -103,17 +103,19 @@ Output Type         *: <input type="text
             var outputType = $("#outputType1").val();
 
             $.ajax({
-                headers: {
+                /*headers: {
                     Accept : "text/plain; charset=utf-8"
+                },*/
+                beforeSend: function(x) {
+                    if (x && x.overrideMimeType) {
+                        x.overrideMimeType("application/j-son;charset=UTF-8");
+                    }
                 },
-                /*beforeSend: function(xhr, s) {
-                 xhr.setRequestHeader("Accept-Encoding" ,"");
-                 xhr.setRequestHeader("Content-Type", "text/xml");
-                 },*/
-
                 type: "POST",
+                dataType: "json",
+                contentType: "application/json;charset=utf-8",
                 url: "http://localhost:7080/airavata-registry-rest-services/registry/api/applicationdescriptor/build/save/test",
-                data: {
+                data: JSON.stringify({
                     appName : appName,
                     exeuctableLocation : exeuctableLocation,
                     scratchWorkingDirectory : scratchWorkingDirectory,
@@ -128,7 +130,7 @@ Output Type         *: <input type="text
                     inputType1 : inputType1,
                     outputName : outputName,
                     outputType : outputType
-                }
+                })
             }).done(function( msg ) {
                         alert( "Data Saved: " + msg );
                     });