Coder Social home page Coder Social logo

Comments (4)

RomanManz avatar RomanManz commented on August 29, 2024 1

Hi thesailored,

if you are still interested, if you just call the auth function after the post/put/get, then it works, e.g.
frisby.create('authorization test')
.get('http://testservice.com')
.auth('username', 'secret', false)
...

Although i am not sure what the third argument (sendImmediate) would be used for.

Regards
Roman

from frisby.

vlucas avatar vlucas commented on August 29, 2024

There is an auth method that does this: https://github.com/vlucas/frisby/blob/master/lib/frisby.js#L278

from frisby.

thesailored avatar thesailored commented on August 29, 2024

Uuuuuuuuuuuuu rock! I'm obviously a noob. I've been in tech 20 years...this is cool stuff. Is there any best place for learning frisby (e.g. man pages, manuals, forums)? So far all I'm finding is github is the best.

//
// HTTP Basic Auth
//
// @param string username
// @param string password
//
Frisby.prototype.auth = function(user, pass) {
authHash = new Buffer(user + ':' + pass).toString('base64');
this.addHeader('Authorization', 'Basic ' + authHash);
return this;
};

from frisby.

thesailored avatar thesailored commented on August 29, 2024

vlucas, Could you please provide me with more info on how to get this to work? I'm struggling with how to tell it which url to use.

var user = 'myUserName'
var password = 'thePassword'
var urlHere = 'http://myserver.net:8080';

//HTTP Basic Auth
// @param string username
// @param string password
Frisby.prototype.auth = function(user, pass) {
authHash = new Buffer(user + ':' + pass).toString('base64');
this.addHeader('Authorization', 'Basic ' + authHash);
return this;
};

from frisby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.