src/app/shared/support/http.utils.ts
Contains common HTTP-related helper methods.
Methods |
|
Public getDefaultHttpHeaders |
getDefaultHttpHeaders()
|
Defined in src/app/shared/support/http.utils.ts:10
|
Returns :
any
|
Public getPaginationParams |
getPaginationParams(page: number, size: number)
|
Defined in src/app/shared/support/http.utils.ts:18
|
Returns :
HttpParams
|
import { HttpHeaders, HttpParams } from '@angular/common/http';
/**
* Contains common HTTP-related helper methods.
*
* @author Gunnar Hillert
*/
export class HttpUtils {
public static getDefaultHttpHeaders() {
const headers = new HttpHeaders({
'Content-Type': 'application/json',
'Accept': 'application/json'
});
return headers;
}
public static getPaginationParams(page: number, size: number): HttpParams {
const params = new HttpParams()
.append('page', page.toString())
.append('size', size.toString());
return params;
}
}