-
Notifications
You must be signed in to change notification settings - Fork 37
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
How to get the redirect url and reuse this url to do get operation? #34
Comments
also if I set .followRedirect(true), I can not get the 200, which mean API-easy can not support it now? |
I guess the quick an easy solution is have a variable and store there the url.
I dont know if suit for you |
hi Daniel, I try your code, but the urlRedir in get() method is undefined. then I add .next() before .get(urlRedir), however, it does Not work. any idea for that? |
I have the same problem, I'd like to save some value returned by one query and use it in next query (as a parameter, for example). I came up @cronopio suggestion on my own, but it is not working (variable is undefined). |
I dont what can be. I have a couple of projects doing that and work. Can you share some gist with the code you have? |
Thanks @cronopio
However, I use the following code before and the urlRedir is
I think the two codes are same, but it is not. |
I am sorry that I have made some mistakes. the For details, please refer to https://gist.github.com/3156327 |
Switching back to pure vows due to this 'undefined' issue. :-| |
hi Charlie,
When I do a post operation and want to get the new url information from redirection. so I can do the new get operation.
I do not how to do that? Could you please help me?
code:
suite.discuss('now we create a project')
.use('localhost', 3000)
.setHeader('Content-Type', 'application/json')
.followRedirect(false)
.path('/projects')
.post( { information : 'good news'})
.expect(302)
.expect('redirect content', function(err, res, body){
...
I know that I can get the url from res.headers.location, but how can I do a get operation with this url??
The text was updated successfully, but these errors were encountered: