小编Pri*_*l85的帖子

多列非聚簇索引中的列顺序是否在SQL Server中很重要?

为SQL Server表创建的多列非聚簇索引中的列顺序是否真的重要?

例如是

CREATE NONCLUSTERED INDEX [MultiFieldIndex_1]  
ON [Table_01] ([Column_A],[Column_B],[Column_C],[Column_D])
Run Code Online (Sandbox Code Playgroud)

与...一样

CREATE NONCLUSTERED INDEX [MultiFieldIndex_1]  
ON [Table_01] ([Column_D],[Column_C],[Column_B],[Column_A]) 
Run Code Online (Sandbox Code Playgroud)

sql-server non-clustered-index

6
推荐指数
1
解决办法
1536
查看次数

将 http 选项设置为 'responseType: 'text'' 会导致使用 Angular HttpClient 的 http post 请求编译失败

虽然 Angular HttpClient 中有一个重载的 API 方法,如下所示:

 post(url: string, body: any | null, options: {
        headers?: HttpHeaders | {
            [header: string]: string | string[];
        };
        observe?: 'body';
        params?: HttpParams | {
            [param: string]: string | string[];
        };
        reportProgress?: boolean;
        responseType: 'text';
        withCredentials?: boolean;
    }): Observable<string>;
Run Code Online (Sandbox Code Playgroud)

当我尝试使用选项 'responseType: 'text'' 执行以下发布请求时,我收到编译器错误,指出“没有重载与此调用匹配。...”

const opts = {
      headers: new HttpHeaders({
        'Accept': 'text/html, application/xhtml+xml, */*',
        'Content-Type': 'text/plain; charset=utf-8'
      }),
      responseType: 'text'
    };
    return this.http.post<string>('url', null, opts);
Run Code Online (Sandbox Code Playgroud)

注意:我明智地传递 null 作为响应主体,因为我的 API 不接受主体。我在这里做的可能是错的吗?

更新 根据 Michael D 的要求添加完整的错误消息 …

angular angular-httpclient angular9

4
推荐指数
1
解决办法
1万
查看次数