banner ad

JSON Request and Response

| March 29, 2013 | 0 Comments
0 Flares 0 Flares ×

JSONRequest is a proposed new standard that could replace XMLHttpRequest and shed the crippling “same domain policy” that makes it a pain to consume outside APIs in Javascript.
request a JSON response

$ curl -s https://dfw.servers.api.rackspacecloud.com/v2/$account/os-networksv2 \
       -X POST \
       -H "X-Auth-Project-Id: $account" \
       -H "Content-Type: application/json" \
       -H "Accept: application/json" \
       -H "X-Auth-Token: $token" \
       -d '{"network": {"cidr": "192.168.0.0/24", "label": "superprivate"}}' | python -m json.tool
The response returns shown in the following JSON response
{
    "network": {
        "cidr": "192.168.0.0/24", 
        "id": "1ff4489e-db0e-45a6-8c9f-4616c6ef5db1", 
        "label": "superprivate"
    }
}
Download PDF
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Reddit 0 StumbleUpon 0 0 Flares ×

Tags:

Category: Uncategorized

About the Author ()

My name is John Link.I am 26 years old. My major is Computer science and technology. I am a junior programmer with Python.

Leave a Reply

Your email address will not be published. Required fields are marked *

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Reddit 0 StumbleUpon 0 0 Flares ×