Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: New to Casablanck SDKs

$
0
0
Coming to your third question

Q: What is the page making the request (if using javascript)?
A: This is the code that I have written in the page. The problem with POST and PUT request was "Access control Headers". Both the code, C++ server code and this html code reside in the same PC. I am able to obtain GET request successfully.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
 <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>


<script type="text/javascript">

    $(document).ready(function () {
        alert('da');
        $.ajax({
            url: "http://localhost:6317/",
            data: JSON.stringify({ "LastName": "O Flynn", "FirstName": "Michael", "Age": 23}),
            type: "get",
            contentType: "application/json",
            dataType: "jsonp",
            jsonpCallback: "localJsonpCallback"
        });

        function localJsonpCallback(json) {
            alert(json.LastName);
        }

    });
</script>
</head>
<body>

</body>
</html>

Viewing all articles
Browse latest Browse all 4845


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>