Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add another curl request for comparison #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add another curl request for comparison #223

wants to merge 1 commit into from

Conversation

tsukune-ch
Copy link

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"
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant