-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
Documentation translation for this article is in progress. | ||
See | ||
[machine translation](https://z5h64q92x9.net/proxy_u/ru-en.en/http/hhru.github.io/api/rendered-docs/docs/cors.md) powered by | ||
[Yandex.Translate](https://translate.yandex.com/translate). | ||
# Cross-Origin Resource Sharing (CORS) | ||
|
||
API supports the CORS technology for requesting browser data from any domain. | ||
This method is preferable to JSONP. Moreover, unlike JSONP, it is not limited by | ||
the GET method. | ||
|
||
To debug requests using CORS, a special URL is available in API: `/cors`. It | ||
supports the HEAD, GET, POST, PUT, DELETE methods. A request with any of these | ||
methods will return the standard response: | ||
|
||
```json | ||
{ | ||
"method": "GET", | ||
"time": "2013-11-18T13:23:17+0400", | ||
"origin": null, | ||
} | ||
``` | ||
|
||
| Name | Type | Description | | ||
|--------|--------------|-----------------------------------------------------------| | ||
| method | string | method used in the request (HEAD, GET, POST, PUT, DELETE) | | ||
| time | string | current time | | ||
| origin | string, null | Origin title value in the request, or null | |