Angular http client发起的请求在Chrome开发者工具network标签页里观察到的界面

146 阅读1分钟

在这里插入图片描述
源代码:

import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';

@Injectable()
export class BookManageService {
  private API_PATH = 'https://www.googleapis.com/books/v1/volumes';
  constructor(private http: HttpClient) { }

  searchBooks(queryTitle: string) {
    return this.http.get(`${this.API_PATH}?q=${queryTitle}`);
  }
}