0

I am using below code to connect to Titan-cassandra-gremlin server to get the data.Return expression is json format.

It gives No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8383' is therefore not allowed access. The response had HTTP status code 400.

When I use GET as dataType , I am getting responce but I want to use "POST".I am getting the above error only on using POST. Please let me know if any one has any idea.

I have browsed about the error but not sure where to place Access-Control-Allow-Origin=true;

I am not sure where to handle in titan server.

 var saveData = $.ajax({

                  url: "http://localhost:8182/?gremlin=g.V().count()",
       dataType: 'json',
    jsonpCallback: 'callback',
      type: 'POST',
      success: function(resultData) { 
        var result=JSON.stringify(resultData);;  
        alert("Save Complete"+result); }
                  });
Ahi
  • 175
  • 1
  • 13
  • Follow this link my be it will help: http://stackoverflow.com/a/20423411/4401414 – Sahadev Jan 02 '17 at 05:50
  • CORS headers and OPTIONS request processing must be handled server side – charlietfl Jan 02 '17 at 06:00
  • Hi, I understand that i should add that up on server side but not sure where to , I am trying to connect to titan server which is used for graphs – Ahi Jan 02 '17 at 06:10

0 Answers0