Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 3 (last question) - Basic HTTP authentication #74

Closed
thesailored opened this issue Feb 26, 2014 · 1 comment
Closed

Part 3 (last question) - Basic HTTP authentication #74

thesailored opened this issue Feb 26, 2014 · 1 comment

Comments

@thesailored
Copy link

Thanks for help! That authed for me.

I think this might be the last question and I'll be all set.

I need to make the auth with several gets (one is shown below with //count of records). If I place the auth in it's on .toss, it does not keep the auth (not using cookies) when I go to my //count of records. So, I'm assuming I need to auth with each new .get. Is there a way to auth in the get? For example, auth in my //count of records.

frisby.create('Test HTTP Basic Auth')
.get('http://someserver.net:8080')
.auth('the_id', 'the_password')
.toss()

//count of records
frisby.create('get a count')
.get('http://someserver.net:8080/service' + '/count')
.expectStatus(200)
.inspectBody()
.toss();

@vlucas
Copy link
Owner

vlucas commented Mar 24, 2014

Yes, if you use auth, you will need to use it in every test. An alternative is to use globalSetup with a raw Authorization header so you won't have to do this.

@vlucas vlucas closed this as completed Mar 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants