1

我有一个桌面应用程序,它必须向其他站点发送 http 请求并获取一些数据和响应 cookie:

这是我发送和http请求的代码HttpClient

getSite(url: string): Observable<HttpResponse<string>> {
    const types = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8';

    const headers = new HttpHeaders()
        .set('Accept', types);

    return this._http.get(
        url,
        {
            observe: 'response',
            headers: headers,
            responseType: 'text',
            withCredentials: true
        }
    );
}

问题是响应中没有set-cookie标头。

webSecurity顺便说一句:由于 CORS 问题,我在创建应用程序窗口时也禁用了

那么问题是什么?

4

0 回答 0