
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@covalent/http
Advanced tools
Deprecation Notice - This component will be deprecated in favor of a different implementation View Doc
It is a framework of decorators on top of the angular [HttpClient] or covalent [TdHttpService] to enhance your services and give them Http capabilities.
Example:
import { Injectable } from '@angular/core';
import { HttpHeaders, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import {
mixinHttp,
TdGET,
TdPOST,
TdBody,
TdParam,
TdResponse,
TdQueryParams,
} from '@covalent/http';
/**
* mixinHttp can use TdHttpService and HttpClient
*/
@Injectable()
export class TestHttpService extends mixinHttp(class {}, {
baseUrl: 'www.mybaseurl.com',
baseHeaders: new HttpHeaders({ 'Accept': 'application/json' }),
}) { // or }, HttpClient) {
/**
* Generates http request [www.mybaseurl.com/myitems] GET and returns an HttpResponse object
*/
@TdGET({
path: '/myitems',
options: {
observe: 'response',
},
})
getResponse(): Observable<HttpResponse<any>> { return; }
/**
* Assuming queryParams = {q: 1}
* Generates http request [www.mybaseurl.com/myitems?q=1] GET and returns the response body parsed in JSON
*/
@TdGET({
path: '/myitems',
})
getParsedResponse(@TdQueryParams() queryParams?: HttpParams): Observable<HttpResponse<any>> { return; }
/**
* Generates http request [www.mybaseurl.com/myitems] GET and returns the number of items after we use `map` of the response body
*/
@TdGET({
path: '/myitems',
})
getMappedResponse(@TdResponse() response?: Observable<HttpResponse<any>>): Observable<number> {
return response.pipe(
map((data: any) => {
return data.items.length;
}),
);
}
/**
* Assuming `id` = 1234
* Generates http request [www.mybaseurl.com/myitems/1234] GET and returns the response body parsed in JSON
*/
@TdGET({
path: '/myitems/:id',
})
get(@TdParam('id') id: string,
@TdResponse() response?: Observable<HttpResponse<any>>): Observable<any> { return; }
/**
* Generates http request [www.mybaseurl.com/myitems] POST with a request body and returns the response body parsed in JSON
*/
@POST({
path: '/myitems',
})
create(@TdBody() body: any,
@TdResponse() response?: Observable<HttpResponse<any>>): Observable<any> {
return response.pipe(
map((data: any) => {
return {
name: data.MyName,
};
}),
);
}
}
FAQs
Teradata UI Platform HttpClient Helper Module
We found that @covalent/http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.