我发送POST / get请求服务有问题。 如果我使用邮差铬扩展它工作正常 但是当我在离子中使用角度Http(不是httpclient)时 它会给出错误 第一个是:允许交叉原点==>这是使用.htaccess完成的 这个我没有找到解决方案:我使用codeIgniter用于后端(客户端从codecanyon购买代码),所以有ci_session cookie,而有角度的http不处理(我所知道的那些 - 你还有其他方法但我不明白) 这是我得到的错误
Request URL:http://kalaatmgouna.com/endpoint/appusers/login/
Request Method:POST
Status Code:403 Forbidden
Remote Address:198.54.126.89:80
Referrer Policy:no-referrer-when-downgrade
Response Headers
view source
Access-Control-Allow-Origin:*
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Length:43
Content-Type:application/json; charset=utf-8
Date:Tue, 24 Oct 2017 20:28:29 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:Apache
Set-Cookie:ci_session=c8873af6f63764f3bfbf80e8c0a43b3659852053; expires=Tue, 24-Oct-2017 22:28:30 GMT; Max-Age=7200; path=/; HttpOnly
X-Powered-By:PHP/5.6.31
Request Headers
view source
Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate
Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,ar;q=0.2
Connection:keep-alive
Content-Length:86
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
DNT:1
Host:kalaatmgouna.com
Origin:http://localhost:8100
Referer:http://localhost:8100/
User-Agent:Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Mobile Safari/537.36
Form Data
view source
view URL encoded
{
"X-API-KEY": "testkey",
"email": "test@email.xyz",
"password": "********"
}:

答案 0 :(得分:0)
状态码:403,需要检查您的服务器端,因为它拒绝您的请求。科尔斯很好。
答案 1 :(得分:0)
您需要使用JWT Auth的角度验证API