I'm trying to send a post request to my server. when I use postman I receive correct data as below
now I want to send this request from factory in my angular project:
var data = [
{
"id": 6155335970855059712,
"userId": 2,
"instagramId": "0x4d_ehdi_wm",
"searchId": "mehdiketabdar",
"mediaId": null,
"phoneNumber": "09368640183",
"name": "mehdi",
"date": 1467546456287,
"otherData": [
]
}
];
var req = {
method: 'POST',
url: 'http://atitec.ddns.net:2500/admin_api/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
request.url = req.url + "mGetListOfOrders";
$http(request);
but I see the error below in my console:
OPTIONS http://atitec.ddns.net:2500/admin_api/mGetListOfOrders net::ERR_EMPTY_RESPONSE