小编Ken*_*eda的帖子

获取请求在邮递员中工作,但在浏览器中不工作

我有一个Angular7在客户端使用的Web应用程序,然后CakePHPApi 我使用的Web应用程序中将Basic Authentication其替换为Token Authentication所有请求都可以正常工作,但只有一个可以在请求中正常运行,Postman但在浏览器中却很奇怪,因为似乎认证存在问题,但不知道原因。

该请求应返回一个Blob以下载文件,因此我使用FPDIin CakePHP来返回pdf

这是邮递员的要求

邮递员头

Date ?Wed, 15 May 2019 12:02:44 GMT
Server ?Apache/2.4.33 (Win32) OpenSSL/1.0.2n PHP/5.6.35
X-Powered-By ?PHP/5.6.35
Content-Disposition ?inline; filename="doc.pdf"
Cache-Control ?private, max-age=0, must-revalidate
Pragma ?public
Access-Control-Allow-Origin ?*
Keep-Alive ?timeout=5, max=100
Connection ?Keep-Alive
Transfer-Encoding ?chunked
Content-Type ?application/pdf
Run Code Online (Sandbox Code Playgroud)

邮递员的身体 邮递员的身体 在Chrome上请求 在Chrome上请求 使用基本身份验证的工作请求 使用基本身份验证的工作请求 使用FireFox

使用FireFox

通话要求

    getWorkListPdf(id: number, cem_id?: number) {
    let uri = `${this.workSessionsUrl}workList/${id}`;
    let params = new HttpParams();
    if (cem_id) {
      params …
Run Code Online (Sandbox Code Playgroud)

php authentication cakephp postman angular

12
推荐指数
1
解决办法
1539
查看次数

标签 统计

angular ×1

authentication ×1

cakephp ×1

php ×1

postman ×1