Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Apr 24 12:45
    zeachco commented #99
  • Apr 24 12:44
    zeachco commented #99
  • Jan 21 20:33
    samuel-loupen edited #138
  • Jan 21 17:08
    samuel-loupen opened #138
  • Dec 16 2020 12:35
    t5unamie opened #137
  • Dec 15 2020 09:20
    CLAassistant commented #136
  • Dec 11 2020 08:25
    CLAassistant commented #129
  • Dec 11 2020 08:25
    CLAassistant commented #130
  • Dec 11 2020 08:25
    CLAassistant commented #136
  • Dec 07 2020 06:23
    CLAassistant commented #130
  • Dec 06 2020 19:51
    CLAassistant commented #136
  • Dec 06 2020 18:40
    CLAassistant commented #129
  • Dec 06 2020 18:15
    CLAassistant commented #130
  • Dec 06 2020 18:15
    CLAassistant commented #136
  • Dec 06 2020 18:15
    CLAassistant commented #109
  • Dec 06 2020 18:14
    CLAassistant commented #129
  • Oct 10 2020 18:06
    adishupadhyay commented #127
  • Oct 10 2020 18:05
    adishupadhyay commented #127
  • Oct 05 2020 10:04
    ungarscool1 edited #136
  • Oct 05 2020 10:03
    ungarscool1 opened #136
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 - http://j.mp/questionsKG
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
module.exports.tax = function (taxinfo) {
            //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 request.post(options);
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 http://unirest.io/
Domain dead?
how do I use Request.aws() 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. :)