Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Aug 15 05:49
    nijikokun commented #129
  • Aug 14 10:05
    crispinkoech commented #129
  • Aug 14 07:01
    crispinkoech commented #129
  • Aug 03 04:02
    huan commented #99
  • Jun 28 10:22
    huan commented #126
  • Jun 27 12:43
    huan commented #126
  • Jun 06 03:42
    mohan491986 opened #133
  • Jun 05 00:40
    mohan491986 opened #132
  • May 30 21:04
    Hisham-TK commented #99
  • Apr 17 19:01
    dpolivy opened #131
  • Mar 31 11:02
    beliga44 opened #130
  • Mar 30 01:04
    kbrandwijk closed #107
  • Feb 26 10:02
    gayathridmallela edited #129
  • Feb 26 10:01
    gayathridmallela opened #129
  • Nov 14 2019 09:18
    Zaynex edited #128
  • Nov 14 2019 09:11
    Zaynex edited #128
  • Nov 14 2019 09:09
    Zaynex edited #128
  • Nov 14 2019 09:09
    Zaynex edited #128
  • Nov 14 2019 09:06
    Zaynex edited #128
  • Nov 14 2019 09:05
    Zaynex opened #128
Sebastian Cheung CQF
Can unirest also connect directly from EC2 instance? Tri Example would be nice.
Tried in mongo shell which works : mongo ec2xxxx-xxxx-xxxxx:27017, but how to do this in unirest
as it is just JSON I am expecting
Hi everyone, I'm struggling with Unirest, I installed the NPM package and when I start my Vue application and require unirest I get this : Module not found: Error: Cannot resolve module 'fs' in C:\Dev\partial-importer\node_modules\unirest
No information found on Google whatsoever
Does anyone know what the heck is going on?
Karan Barsiwal
anyone online?
Maxim V
hey guys
I just found this nice library, called unirest
where can I download it?
for browser usage
Пушкин Денис
Привет! Есть русские?
Ashok Bakthavathsalam
Unirest rocks! Here's a small project I used it on Hyperdev -
I am keen to find out what changes need to be done to make it run without Node.js
Hello everyone
i am new to nodejs/javascript
var cityId = unirest.get(url).end(function (response) {
if (response.status === 200) {
return response.body.content[0].id;
how i can return parsed response body in above code block ?
thank you very much
Gianluca Saroni
hi guys, i'm trying to use unirest (npm install unirest), but i'm getting this error : "deprecated node-uuid@1.4.7: use uuid module instead" any suggestion?
hey guys
does any one know how to upload a string as a file ? :)
tried '.attach('file', 'test.txt', 'some text in file') // Attachment'
Robert Buchanan
With Unirest for Nodejs is it possible to set defaults at an application level such as a the 'Authorization' header without wrapping it in my own service/export?
@ioneyed just use CookieJar to keep the session ?
Aaron Bell
@awb715 = function (taxinfo) {"").headers({
            //api key
            'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBUElfS0VZX01BTkFHRVIiLCJodHRwOi8vdGF4ZWUuaW8vdXNlcl9pZCI6IjU4NDQ4MTA4Mzg2NjhhMTU4ZDU0ZmIzNSIsImh0dHA6Ly90YXhlZS5pby9zY29wZXMiOlsiYXBpIl0sImlhdCI6MTQ5OTA1MzU0NX0.pOwC5JEC7trLaaZVgHHGu_rvN0-EGa3RMm8BgJ-M9gk"
            , 'Content-Type': 'application/x-www-form-urlencoded'
        //info to be pulled from form 
            "exemptions": 1
            , "filing_status": "single"
            , "pay_periods": 1
            , "pay_rate": taxinfo.income || 100000
            , "state": taxinfo.State || "NY"
        }).end(function (result) {
            return result.body.annual;
the result wont return in the express route response the call it
i dont understand why
Akash Chandra

Is there a way to assert no_delay for tcp packets in request.js library?

Also, is the same possible in standard library viz unirest.js

I found the same in node-rest-client using request-config

requestConfig: {
timeout: 1000, //request timeout in milliseconds
noDelay: true, //Enable/disable the Nagle algorithm
keepAlive: true, //Enable/disable keep-alive functionalityidle socket.
keepAliveDelay: 1000 //and optionally set the initial delay before the first keepalive probe is sent
I want to disable the Nagle algo as I see huge packets delay while load testing our application.

Need help in setting the same for request.js

hi guys, does unirest support es6?
hey is it possible to download a pdf file with unirest ? :)
Shoaib Mansoor

Hello Everyone,
I am following a case where I need to pass some cetificates for SSL authentication beore making any request.
I have tried to use 'request-promise-native' and got the correct response.
This is how I created request using 'request-promise-native':

const request = require('request-promise-native');
const options = {
    uri: baseUri + endPoint,
    port: 443,
    method: 'POST',
    headers: {
        'Content-type': 'application/json',
    cert: fs.readFileSync('cert.pem'),
    key: fs.readFileSync('key.pem'),
    ca: fs.readFileSync('ca.pem'),
const req = await;
console.log(req); // Correct response

I tried the perform the same request using 'Unirest' but I am receiving the following error:
Request Code:

const request = require('unirest');
const req = await request
            .post(baseUri + ':' + port + endPoint)
            .header({'Content-Type': 'application/json'})
            .attach({cert: fs.readFileSync('cert.pem')})
            .attach({key: fs.readFileSync('key.pem')})
            .attach({ca: fs.readFileSync('ca.pem')})
console.log(req); //  {"error":{"code":"EPROTO","errno":"EPROTO","syscall":"write"}}

Also I tried to pass certificates using part & field method provided by Unirest, but same error message is received.
Can someone please guide me on this? Any help will be appreciated. Thanks.

A JSONObject text must begin with \'{\'
Any solution to this?
.header('authorization', 'Basic asdasdasdasdasd')
.header('cookie', 'Version=1;')
.field('metadata', '\'{\'\'}\'') // Form field
.attach('file', fs.createReadStream('abc.txt'), {})
.end(function (response: any) {
Hello, I have a little problem with my code.
I want to return a value that i get from the response from an unirest.get() but I can't with return inside the callback and outside due to the scope. I wanted to know if there was a way to return a value that i get from the response without doing another function outside the one I use. Thank you in advance for any help. (Sorry for my bad english, FR)
Nijiko Yonskai
@/all I have published 0.6.0 which includes promise support, and resolves the security / vulnerable bits.
With promise support comes support for Node Engines > 8 or 4 with the --harmony flag.
Hello there
Kovalchuk Evgeny
Hey guys, can I set content-type for particular "attach"? Like .attach('file', fs.createReadStream(path.join(__dirname, 'demo.po'), {"content-type": "multipart/form-data"})
Simon Fredrich
Hello, how do I use unirest inside a little html project?
Gabriel Arocha
hey guys
im new in js
is possible to execute unirest with yarn?
(dont hit me hhahaa)
Christian Lagerkvist
Can't seem to reach
Domain dead?
how do I use to retrieve a file and attach it to .attach('file',__)
Michael Callaghan
Does anyone know how to authenticate a request using a public/private keys? I generated some with openssl, sent one key to the service I'm calling, and now need to provide the other key in the request. I'm at a loss. :)