go-json-rest icon indicating copy to clipboard operation
go-json-rest copied to clipboard

add another curl request for comparison

Open tsukune-ch opened this issue 8 years ago • 0 comments

The current CORS curl demo will not return a response containing CORS headers. I think it would be better to add a curl demo that returns a response containing that.

$ curl -i http://127.0.0.1:8080/countries
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Powered-By: go-json-rest
Date: Mon, 04 Dec 2017 18:18:01 GMT
Content-Length: 105

[
  {
    "Code": "FR",
    "Name": "France"
  },
  {
    "Code": "US",
    "Name": "United States"
  }
]
$ curl -H "Origin: http://my.other.host" -i http://127.0.0.1:8080/countries
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://my.other.host
Content-Type: application/json; charset=utf-8
X-Powered-By: go-json-rest
Date: Mon, 04 Dec 2017 18:18:21 GMT
Content-Length: 105

[
  {
    "Code": "FR",
    "Name": "France"
  },
  {
    "Code": "US",
    "Name": "United States"
  }
]

tsukune-ch avatar Dec 04 '17 18:12 tsukune-ch