Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- General
- Request URL: http://localhost:8080/rest/user/login?username=1@1&password=12345
- Request Method: POST
- Status Code: 200
- Remote Address: [::1]:8080
- Referrer Policy: no-referrer-when-downgrade
- Response
- Access-Control-Allow-Origin: *
- Cache-Control: no-cache, no-store, max-age=0, must-revalidate
- Content-Length: 230
- Date: Tue, 08 May 2018 14:31:08 GMT
- Expires: 0
- Pragma: no-cache
- Set-Cookie: JSESSIONID=C19E560EBF7C0F96FCE7361ECE1B7D12; Path=/; HttpOnly
- X-Content-Type-Options: nosniff
- X-Frame-Options: DENY
- X-XSS-Protection: 1; mode=block
- Request URL: http://localhost:8080/rest/vds/list?pageNumber=0&pageSize=15
- General
- Request URL: http://localhost:8080/rest/vds/list?pageNumber=0&pageSize=15
- Request Method: GET
- Status Code: 401
- Remote Address: [::1]:8080
- Referrer Policy: no-referrer-when-downgrade
- Responce
- Access-Control-Allow-Origin: *
- Cache-Control: no-cache, no-store, max-age=0, must-revalidate
- Content-Type: application/json;charset=UTF-8
- Date: Tue, 08 May 2018 14:31:27 GMT
- Expires: 0
- Pragma: no-cache
- Transfer-Encoding: chunked
- X-Content-Type-Options: nosniff
- X-Frame-Options: DENY
- X-XSS-Protection: 1; mode=block
- Request
- Accept: application/json, text/plain, */*
- Accept-Encoding: gzip, deflate, br
- Accept-Language: en-US,en;q=0.9,ru;q=0.8
- Connection: keep-alive
- Host: localhost:8080
- Origin: http://localhost:4200
- Referer: http://localhost:4200/vds-list
- User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
- @Injectable()
- export class CoreApi {
- private baseUrl = 'http://localhost:8080/rest/';
- constructor(public http: HttpClient) {
- }
- public get(url: string = ''): Observable<any> {
- return this.http.get(this.getUrl(url));
- }
- public post(url: string, data: any = {}): Observable < any > {
- return this.http.post(this.getUrl(url), data);
- }
- private getUrl(url: string = ''): string {
- return this.baseUrl + url;
- }
- }
- @Injectable()
- export class VdsService extends CoreApi {
- constructor(public http : HttpClient) {
- super(http);
- }
- getVdsList() : Observable < Vds[] > {
- return this.get(`vds/list?pageNumber=0&pageSize=15`).map((data : Vds[]) => data);
- }
- }
Add Comment
Please, Sign In to add comment