This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

Jsonp

npm Package @angular/http
Module import { Jsonp } from '@angular/http';
Source http/src/http.ts

Deprecation Notes

use @angular/common/http instead

Overview

      
      class Jsonp extends Http {
  constructor(backend: ConnectionBackend, defaultOptions: RequestOptions)
  request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>
  // inherited from http/Http
  protected _backend: ConnectionBackend
  protected _defaultOptions: RequestOptions
  request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>
  get(url: string, options?: RequestOptionsArgs): Observable<Response>
  post(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>
  put(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>
  delete(url: string, options?: RequestOptionsArgs): Observable<Response>
  patch(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>
  head(url: string, options?: RequestOptionsArgs): Observable<Response>
  options(url: string, options?: RequestOptionsArgs): Observable<Response>
}
    

Constructor

      
      constructor(backend: ConnectionBackend, defaultOptions: RequestOptions)
    

Members

      
      request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>
    

Performs any type of http request. First argument is required, and can either be a url or a Request instance. If the first argument is a url, an optional RequestOptions object can be provided as the 2nd argument. The options object will be merged with the values of BaseRequestOptions before performing the request.

Annotations

      
      @Injectable()