
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@testjg/nativescript-http
Advanced tools
Http helper lib. Under the hood it uses okhttp
(v3) for Android and NSURLSession
for iOS.
Has peer dependencies on url-join and rxjs.
ns plugin add @testjg/nativescript-http
import { createHttp, forRelativeUrl } from '@testjg/nativescript-http';
import { firstValueFrom } from 'rxjs';
import { catchError, switchMap } from 'rxjs/operators';
export class TodosService {
http = createHttp('https://jsonplaceholder.typicode.com');
todos = forRelativeUrl('todos', this.http);
fetchTodo(id: number) {
const json$ = this.todos
.request({
method: 'GET',
url: `${id}`,
headers: { 'Accept-Language': ['ca', 'en'] },
})
.pipe(
switchMap((res) => res.json()),
catchError((error) => null),
);
return firstValueFrom(json$);
}
}
Pro tip: Use functions like jsonBody
or multiPartBody
to create the appropiate request content.
Apache License Version 2.0
FAQs
Add a plugin description
The npm package @testjg/nativescript-http receives a total of 2 weekly downloads. As such, @testjg/nativescript-http popularity was classified as not popular.
We found that @testjg/nativescript-http demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.