Installations
npm install nativescript-okhttp
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.7.0
NPM Version
6.2.0
Score
67.4
Supply Chain
90
Quality
82.7
Maintenance
100
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
kiril-stanoev
Download Statistics
Total Downloads
6,149
Last Day
1
Last Week
5
Last Month
20
Last Year
184
GitHub Statistics
5 Stars
19 Commits
5 Forks
27 Watching
1 Branches
7 Contributors
Package Meta Information
Latest Version
0.0.9
Package Id
nativescript-okhttp@0.0.9
Unpacked Size
1.65 MB
Size
1.28 MB
File Count
43
NPM Version
6.2.0
Node Version
10.7.0
Total Downloads
Cumulative downloads
Total Downloads
6,149
Last day
0%
1
Compared to previous day
Last week
-54.5%
5
Compared to previous week
Last month
122.2%
20
Compared to previous month
Last year
-23.7%
184
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
NativeScript plugin for OkHttp
OkHttp is an HTTP client that supports:
- HTTP/2 and SPDY support allows all requests to the same host to share a socket.
- Connection pooling reduces request latency (if SPDY isn’t available).
- Transparent GZIP shrinks download sizes.
- Response caching avoids the network completely for repeat requests.
Installation
Run the following command from the root of your project:
$ tns plugin add nativescript-okhttp
This command automatically installs the necessary files, as well as stores nativescript-okhttp as a dependency in your project's package.json
file.
Usage
To use the social share module you must first require()
it. After you require()
the module you have access to its APIs.
1var okHttp = require("nativescript-okhttp");
API
getString(url)
The getString()
method downloads a URL as a string.
1var okHttp = require("nativescript-okhttp"); 2function pageLoaded(args) { 3 var result = okHttp.getString("http://www.google.com/"); 4 console.log(result); 5} 6exports.pageLoaded = pageLoaded;
getJSON(url)
The getString()
method downloads a URL as a string.
1var okHttp = require("nativescript-okhttp"); 2function pageLoaded(args) { 3 var json = okHttp.getJSON("https://api.github.com/gists/c2a7c39532239ff261be"); 4 console.log("JSON url: " + json.url); 5} 6exports.pageLoaded = pageLoaded;
getImage(url)
The getImage()
method returns an image as a stream from a remote URL.
In this example, we will download an image from umgur (http://i.imgur.com/sXG9IHW.jpg) and we will share it ot Facebook using a social share plugin by @tjvantoll (https://github.com/tjvantoll/nativescript-social-share).
1var socialShare = require("nativescript-social-share"); 2var imageSource = require("image-source"); 3var okHttp = require("nativescript-okhttp"); 4function pageLoaded(args) { 5 var inputStream = okHttp.getImage("http://i.imgur.com/sXG9IHW.jpg"); 6 var image = imageSource.fromData(inputStream); 7 socialShare.shareImage(image); 8} 9exports.pageLoaded = pageLoaded;
No vulnerabilities found.
Reason
0 existing vulnerabilities detected
Reason
binaries present in source code
Details
- Warn: binary detected: platforms/android/libs/okhttp-2.5.0.jar:1
- Warn: binary detected: platforms/android/libs/okio-1.6.0.jar:1
Reason
Found 2/17 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
2.5
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More