Bad to hear, its not supported, heres my scenario:
We have TP on IIS, as usual,
on the other side our Intranet... it runs with mysql and php...
On the IIS side I have set the Response Headers for CORS:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: OPTIONS, TRACE, GET, POST, PUT
Access-Control-Allow-Headers: Content-Type,Accept,authorization,x-request,x-request-with
Access-Control-Allow-Credentials: true
On Intranet, or any other Server, I try to POST something (mootools):
var testdata = JSON.encode({
Name:"TESTSTORY",
Feature: {
Id: 7894
}
});
new Request({
method:'POST',
data: testdata,
headers:{
'Accept': 'Content-Type, application/json, text/html; charset=utf-8',
'Authorization': 'Basic [CODE]',
'Origin': '...',
'Host' : '[HOST]',
'Content-Length': testdata.length
},
url: '[HOST]/TP2/api/v1/UserStories',
onSuccess: function(a,b){
...
},
onFailure: function(a,b){
...
}
}).send();Now here is what I get:
405 Method not Allowed
Response-Header
| Access-Control-Allow-Cred... | true |
| Access-Control-Allow-Head... | Content-Type,Accept,authorization,x-request,x-request-with |
| Access-Control-Allow-Meth... | OPTIONS, TRACE, GET, POST, PUT |
| Access-Control-Allow-Orig... | * |
| Cache-Control | private |
| Content-Length | 3033 |
| Content-Type | text/html; charset=utf-8 |
| Date | Fri, 06 Jul 2012 11:41:27 GMT |
| Server | Microsoft-IIS/7.5 |
| X-AspNet-Version | 4.0.30319 |
Request-Header
| Accept | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| Accept-Encoding | gzip, deflate |
| Accept-Language | de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 |
| Access-Control-Request-He... | authorization,x-requested-with |
| Access-Control-Request-Me... | POST |
| Cache-Control | no-cache |
| Connection | keep-alive |
| Host | [HOST] |
| Origin | [ORIGIN] |
| Pragma | no-cache |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0 |
I tried different combinations, e.g. without allow-credentials on IIS.
I tried with and without Authorization, nothing worked.
Thanks,
Daniel