How to use the @angular/http.RequestMethod.Get function in @angular/http

To help you get started, we’ve selected a few @angular/http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dotCMS / core-web / src / app / api / services / dot-menu.service.ts View on Github external
loadMenu(): Observable {
        if (!this.menu$) {
            this.menu$ = this.coreWebService
                .requestView({
                    method: RequestMethod.Get,
                    url: this.urlMenus
                })
                .pipe(
                    publishLast(),
                    refCount(),
                    pluck('entity')
                );
        }

        return this.menu$;
    }
github radiium / turntable / src / app / _core / services / youtube-data.service.ts View on Github external
getVideosById(videosId: string) {

        const videosByIdUrl =
            CONSTANT.VIDEO_API +
            '?part=snippet,contentDetails,status,player' +
            '&id=' + videosId +
            '&key=' + CONSTANT.KEY_API;

        return this._http
        .request(videosByIdUrl, {method: RequestMethod.Get, headers: new Headers()})
        .map((res) => res.json());
    }
}
github benbaran / adal-angular4 / src / adal4-http.service.ts View on Github external
get(url: string, options?: RequestOptionsArgs): Observable {
    let options1 = new RequestOptions({ method: RequestMethod.Get });
    options1 = options1.merge(options);
    return this.sendRequest(url, options1);
  }
github outcobra / outstanding-cobra / frontend / src / app / core / http / http-interceptor.ts View on Github external
request(request: RequestOptions): Observable {
        request.method = (request.method || RequestMethod.Get);
        request.url = (request.url || '');
        request.headers = (request.headers || {});
        request.data = (request.data || {});
        request.params = (request.params || {});
        request.apiName = (request.apiName || this._defaultApiName);

        this._interpolateUrl(request);

        this._addContentType(request);

        this._addAuthToken(request);

        return this.http.request(
            new Request({
                method: request.method,
                url: this._buildApiUrl(request),
github ecsnavarretemit / sarai-interactive-maps / src / app / map / pages / rainfall-maps / rainfall-map.service.spec.ts View on Github external
backend.connections.subscribe((connection: MockConnection) => {
        const options = new ResponseOptions({
          body: JSON.stringify(dataToSend)
        });

        connection.mockRespond(new Response(options));

        expect(connection.request.method).toEqual(RequestMethod.Get);
        expect(connection.request.headers.get('Content-Type')).toEqual('application/json');
      });
github angular / universal / examples / next-hello-world / src / universal_modules / platform-node / node-http.ts View on Github external
constructor(
    req: Request,
    baseResponseOptions: ResponseOptions,
    ngZone: NgZone,
    @Optional() @Inject(ORIGIN_URL) originUrl: string = '',
    @Optional() @Inject(BASE_URL) baseUrl?: string) {

    if (req.method !== RequestMethod.Get) {
      throw new TypeError(JSONP_ERR_WRONG_METHOD);
    }


    this.request = req;
    baseUrl = baseUrl || '/';

    if (originUrl === null) {
      throw new Error('ERROR: Please move ORIGIN_URL to platformProviders');
    }

    let _reqInfo: any = url.parse(url.resolve(url.resolve(originUrl, baseUrl), req.url));
    _reqInfo.method = RequestMethod[req.method].toUpperCase();

    if (isPresent(req.headers)) {
      _reqInfo.headers = {};
github dotCMS / core-web / src / app / api / services / notifications-service.ts View on Github external
getLastNotifications(): Observable {
        return this.coreWebService.request({
            method: RequestMethod.Get,
            url: this.urls.getLastNotificationsUrl
        });
    }
github angular / universal / modules / platform-node / node-http.ts View on Github external
constructor(
    req: Request,
    baseResponseOptions: ResponseOptions,
    ngZone: NgZone,
    @Optional() @Inject(ORIGIN_URL) originUrl: string = '',
    @Optional() @Inject(APP_BASE_HREF) baseUrl?: string) {

    if (req.method !== RequestMethod.Get) {
      throw new TypeError(JSONP_ERR_WRONG_METHOD);
    }


    this.request = req;
    baseUrl = baseUrl || '/';

    if (originUrl === null) {
      throw new Error('ERROR: Please move ORIGIN_URL to platformProviders');
    }

    let _reqInfo: any = url.parse(url.resolve(url.resolve(originUrl, baseUrl), req.url));
    _reqInfo.method = RequestMethod[req.method].toUpperCase();

    if (isPresent(req.headers)) {
      _reqInfo.headers = {};
github microsoft / IIS.WebManager / src / app / versioning / version.service.ts View on Github external
private makeApiRequest(): Promise {
        let opts = this._httpClient.getOptions(RequestMethod.Get, "/", null);
        return this._httpClient.request("/", opts);
    }
github r-park / soundcloud-ngrx / src / app / core / services / api / api-service.spec.ts View on Github external
backend.connections.subscribe((c: MockConnection) => {
            expect(c.request.method).toBe(RequestMethod.Get);
            expect(c.request.url).toMatch(`${API_USERS_URL}/${userId}/tracks`);
            expect(c.request.url).toMatch(CLIENT_ID_PARAM);
          });