小编Gaw*_*van的帖子

'{header:Header;}'类型的参数不能分配给'RequestOptionsArgs'类型的参数

我尝试在HTTP.POST/GET请求中传递标头时出现以下错误 Argument of type '{header:Header;}' is not assignable to parameter of type 'RequestOptionsArgs'. Property 'null' is missing in the type '{header:Header;}'

我尝试了很多解决方案,但没有锁定它.

我的代码:

import { Injectable } from '@angular/core';
import { Response, RequestOptions, Headers, Http, URLSearchParams} from '@angular/http';
import { Observable, Subject } from 'rxjs/Rx';  
import {Company} from './companyMaster';
import 'rxjs/add/operator/map';
import "rxjs/Rx";
import 'rxjs/add/operator/toPromise';
import {CommonService} from '../../common.service';
@Injectable()
export class CompanyMasterService {
private GetListActionUrl: string;
private AddEditActionUrl: string;
public headers = new Headers({ 'Content-Type': 'application/json' });
public options …
Run Code Online (Sandbox Code Playgroud)

node.js rxjs angular2-routing angular2-services angular

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