I had this code:
this.organizationServicesCollection.url = 'http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/'
var fetchParameters = {
data: JSON.stringify({
parameters: {'key':'value'}
}),
type: 'POST',
contentType: 'application/json'
};
this.organizationServicesCollection.fetch(fetchParameters);
when executed I was having two resulting requests:
Request URL:http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/
Request Method:OPTIONS
Request URL:http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/
Request Method:POST
The problem was that my current proyect was being run in http://localhost:49998/ instead http://localhost/ so there was a cross domain issue. I fixed it running my project in http://localhost/ , now when running the code I had my single POST request:
Request URL:http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/
Request Method:POST
this.organizationServicesCollection.url = 'http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/'
var fetchParameters = {
data: JSON.stringify({
parameters: {'key':'value'}
}),
type: 'POST',
contentType: 'application/json'
};
this.organizationServicesCollection.fetch(fetchParameters);
when executed I was having two resulting requests:
Request URL:http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/
Request Method:OPTIONS
Request URL:http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/
Request Method:POST
The problem was that my current proyect was being run in http://localhost:49998/ instead http://localhost/ so there was a cross domain issue. I fixed it running my project in http://localhost/ , now when running the code I had my single POST request:
Request URL:http://localhost/SkyDesk.Services/SrvService.svc/rest/service/queryservices/
Request Method:POST
No comments:
Post a Comment