@@ -7,10 +7,12 @@ import { Observable } from 'rxjs';
77export class SimpleHttpService {
88 constructor ( private http : HttpClient ) { }
99 /**
10- * Generates the query parameters to be used for a HTTP DELETE request
10+ * Constructs and sends a HTTP DELETE request
1111 * @param apiEndpoint The API endpoint
1212 * @param apiParams Parameters to append to the API endpoint
1313 * @param apiHeaders HTTP headers to append to the request
14+ * @template P A TypeScript interface to type the HTTP request's parameters to
15+ * @template R A TypeScript interface to type the HTTP request's response to
1416 * @return A `HttpClient` instance
1517 */
1618 createHttpDelete < P extends any , R extends any > ( apiEndpoint : string , apiParams : P , apiHeaders : HttpHeaders = null ) : Observable < R > {
@@ -38,10 +40,12 @@ export class SimpleHttpService {
3840 }
3941 }
4042 /**
41- * Generates the query parameters to be used for a HTTP GET request
43+ * Constructs and sends a HTTP GET request
4244 * @param apiEndpoint The API endpoint
4345 * @param apiParams Parameters to append to the API endpoint
4446 * @param apiHeaders HTTP headers to append to the request
47+ * @template P A TypeScript interface to type the HTTP request's parameters to
48+ * @template R A TypeScript interface to type the HTTP request's response to
4549 * @return A `HttpClient` instance
4650 */
4751 createHttpGet < P extends any , R extends any > ( apiEndpoint : string , apiParams : P , apiHeaders : HttpHeaders = null ) : Observable < R > {
@@ -69,11 +73,14 @@ export class SimpleHttpService {
6973 }
7074 }
7175 /**
72- * Generates the query parameters to be used with the API endpoint
76+ * Constructs and sends a HTTP POST request
7377 * @param apiEndpoint The API endpoint
7478 * @param apiParams Parameters to append to the API endpoint
7579 * @param apiBody The request body
7680 * @param apiHeaders HTTP headers to append to the request
81+ * @template B A TypeScript interface to type the HTTP request's body to
82+ * @template P A TypeScript interface to type the HTTP request's parameters to
83+ * @template R A TypeScript interface to type the HTTP request's response to
7784 * @return A `HttpClient` instance
7885 */
7986 createHttpPost <
@@ -126,11 +133,14 @@ export class SimpleHttpService {
126133 }
127134 }
128135 /**
129- * Generates the query parameters to be used with the API endpoint
136+ * Constructs and sends a HTTP PUT request
130137 * @param apiEndpoint The API endpoint
131138 * @param apiParams Parameters to append to the API endpoint
132139 * @param apiBody The request body
133140 * @param apiHeaders HTTP headers to append to the request
141+ * @template B A TypeScript interface to type the HTTP request's body to
142+ * @template P A TypeScript interface to type the HTTP request's parameters to
143+ * @template R A TypeScript interface to type the HTTP request's response to
134144 * @return A `HttpClient` instance
135145 */
136146 createHttpPut <
0 commit comments