Canadian Tire Documentation
The 'Echo' service provides an API that returns in the response what it is sent.
You can use the common HTTP methods (GET, POST, PATCH, PUT and DELETE) in the path. For example, this curl POST request:
curl -X POST "http://canadiantire.api.mashery.com/echo/post?api_key=xxxxxfvhy25sz9yjss6v4um4" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "body=some post data"
Returns a response:
{
"args": {
"api_key": "xxxxxfvhy25sz9yjss6v4um4"
},
"data": "",
"files": {},
"form": {
"body": "some post data"
},
"headers": {
"Accept": "application/json",
"Connection": "close",
"Content-Length": "19",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "httpbin.org",
"User-Agent": "Mashery Proxy",
"X-Original-User-Agent": "curl/7.54.0"
},
"json": null,
"origin": "174.71.254.226, 54.82.131.49",
"url": "http://httpbin.org/post?api_key=xxxxxfvhy25sz9yjss6v4um4"
}
Note, the API key is obfuscated in the above example.
There are three additional requests:
- /ip - returns the source IP(s).
- /user-agent - returns the client UA.
- /headers - returns all the request headers.
Here's the example for IPs:
curl "http://canadiantire.api.mashery.com/echo/ip?api_key=xxxxxfvhy25sz9yjss6v4um4" -H "accept: application/json"
{
"origin": "174.71.254.226, 54.82.131.63"
}
0 Comments
Please sign in to post a comment.