angular2-http

    1热度

    1回答

    我正在使用Angular2 http模块发送http请求。用户登录后,后端服务器将生成一个cookie会话,前端将使用此凭据发送请求。下面是角码: get(url: string) { let options = new RequestOptions({headers: this.headers, withCredentials: true }); return this.ht

    0热度

    1回答

    我是Angular 2中的新成员,而且我很困扰HTTP。 该应用程序运行,但当我尝试让我的InMemoryDbService失败。 的错误是: EXCEPTION: Uncaught (in promise): TypeError: Cannot read property '0' of undefined ,但我并不想获得 '0' 属性。 clientes.service.ts import {

    0热度

    1回答

    我正在开发一个项目,一切正常......当我向API请求某些东西(如下面的例子)时,它只会发送一个请求: this.httpClient.get<MyInterface>('my_api').subscribe(data => this.items = data); 但我想在新的HttpClient中利用拦截器,所以我开始搜索示例,并且我找到了this。 我定义的一切,在后: 进步,inter

    -4热度

    1回答

    我无法获取JSON本地文件Angular HTTP服务。我有这些代码: import {Injectable} from '@angular/core'; import {Http, Response} from "@angular/http"; import 'rxjs/add/operator/map' @Injectable() export class ApiService {

    -1热度

    1回答

    我有一个过程: products = [] getAllProducts(){ this.http.get (this.baseUrl + '/products').map((resp:Response) => resp.json()) .subscribe( (data) => { const products = data;

    5热度

    1回答

    我遇到问题uploading multiple file to different urls using ng2-file-upload method。 我使用此回购https://github.com/valor-software/ng2-file-upload 来做到这一点。 ng2-file-upload可以使用此demo轻松集成到我的应用中以上传文件。此外,他们还提供了一个method来上

    0热度

    2回答

    这是我的服务器数据: [ { "name" : "testname" }, { "name" : "testnametwo" } ] 我试图用Angular2 http.get得到这个数据。我想用下面的代码: private _url : string = "appone/api/user.json" user =

    -1热度

    4回答

    我有一个使用角度的HTTP服务 @Injectable() export class MyService { constructor(private http: Http) { } getThings() { return this.http.get('url').map((res) => { // massage data here and ret

    6热度

    2回答

    我正在使用角4,我试图从2个端点获取数据,但我对rxjs有一个理解问题。 使用此代码我只能获取学生和用户列表。 getStudent() { return this.http.get(this.url + this.student_url, this.getHeaders()).map(res => res.json()); } getUsers() { retu

    0热度

    2回答

    我想发布一个简单的HTTP请求,但是后端不能接收放慢参数 export class AppComponent { isMenuCollapsed$:Observable<boolean>; constructor(private store:Store<reducers.State>,private http:Http) { this.isMenuCollapse