Gathering detailed insights and metrics for okhttp
Gathering detailed insights and metrics for okhttp
Gathering detailed insights and metrics for okhttp
Gathering detailed insights and metrics for okhttp
cordova-plugin-okhttp
Uses OkHttp for network requests initiated from Java (e.g. via FileTransfer plugin).
nativescript-okhttp
[OkHttp](http://square.github.io/okhttp/) is an HTTP client that supports:
@goast/kotlin
Provides gOAst generators for generating Kotlin code from OpenAPI specifications.
prhttp
A JavaScript HTTP interceptor inspired by okhttp
Lightweight HTTP library for Node.js inspired by Square's OkHttp Builder patterns
npm install okhttp
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
11 Stars
31 Commits
1 Watchers
1 Branches
1 Contributors
Updated on May 03, 2023
Latest Version
1.1.0
Package Id
okhttp@1.1.0
Size
56.08 kB
NPM Version
3.8.9
Node Version
6.2.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
a lightweight HTTP
library for Node.js
inspired by Square's Android OkHttp
Builder patterns and flavours
for constructing a legit HTTP
requests of all types.
Written entirely in EcmaScript 6 (Harmony) and transpiled with Babel
.
npm install okhttp
npm install --production okhttp
(if you have the following modules installed globally babel-cli, babel-plugin-transform-object-assign,babel-preset-es2015
,
then use)HTTP
methods.Request
builder.Form Encoding
body builder.Multipart
body builder.Mime
builder.Request Body
composer.Promise
api for intuitive async.1const okhttp = require('okhttp'); 2 3var MimeBuilder = okhttp.MimeBuilder; 4var Request = okhttp.Request; 5var RequestBody = okhttp.RequestBody; 6var RequestBuilder = okhttp.RequestBuilder; 7var FormEncodingBuilder = okhttp.FormEncodingBuilder; 8var MultiPartBuilder = okhttp.MultiPartBuilder; 9 10/** 11 * @param msg a {data, response, request} Object 12 */ 13private function onComplete(msg):void { 14 console.log('data ' + msg.data + ', response ' + msg.response.statusCode + ', request ' + msg.request.method); 15} 16 17private function onError(err):void { 18 console.error(err); 19} 20
GET
request1new RequestBuilder().GET('http://google.com').buildAndExecute().then(onComplete).catch(onError); 2
GET
request1new RequestBuilder().GET('http://maps.google.com/mapfiles/kml/pushpin/blue-pushpin.png').bufferResponse().buildAndExecute().then(onComplete).catch(onError); 2
JSON POST
request1new RequestBuilder().url('http://httpbin.org/post') 2 .POST(RequestBody.create({a:'a1', b:'b1'}, new MimeBuilder().contentType('application/json', 'charset', 'utf8').build())) 3 .buildAndExecute().then(onComplete).catch(onError); 4
Form Encoding POST (www-form-urlencoded)
request1let fe_body = new FormEncodingBuilder().add('key1', 'value1').add('key2', 'value2').build(); 2 3new RequestBuilder().url('http://httpbin.org/post').POST(fe_body).buildAndExecute() 4 .then(onComplete).catch(onError); 5
MultiPart
request:1let json = JSON.stringify({title:'test'}); 2var image = fs.readFileSync(path.resolve(__dirname, 'test.jpg')); 3 4let mp_body = new MultiPartBuilder().addPart(RequestBody.create(json, 'Content-Type: application/json; charset=UTF-8')) 5 .addPart(RequestBody.create(image, new MimeBuilder().contentType('image/jpeg').contentTransferEncoding('binary').build())) 6 .type(MultiPartBuilder.FORMDATA).build(); 7 8new RequestBuilder().url('https://www.googleapis.com/upload/drive/v2/files?uploadType=multipart') 9 .header('Authorization', 'Bearer OAUTH2_TOKEN_HERE') 10 .POST(mp_body).buildAndExecute().then(onComplete).catch(onError); 11
POST
image requestGoogle Glass Mirror API
1public function uploadImage(image, itemId, oauthToken):void { 2 3 var body = RequestBody.create(image, 'Content-Type: image/png'); 4 5 new RequestBuilder().url("https://www.googleapis.com/upload/mirror/v1/timeline" + "/" + itemId + "/attachments") 6 .query("access_token", oauthToken) 7 .POST(body).build().execute() 8 .then(onComplete).catch(onError); 9} 10
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
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
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
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