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

use the FastHttpLocust,how to get cookies ? #861

Closed
yanchunhuo opened this issue Aug 9, 2018 · 5 comments
Closed

use the FastHttpLocust,how to get cookies ? #861

yanchunhuo opened this issue Aug 9, 2018 · 5 comments

Comments

@yanchunhuo
Copy link

Description of issue / feature request

@heyman hello,
from locust import TaskSet,task
from locust.contrib.fasthttp import FastHttpLocust

response = self.client.post()

how can get cookies from server response?

Expected behavior

can get cookies

Actual behavior

can not get cookies

Environment settings (for bug reports)

  • OS:
  • Python version:
  • Locust version:

Steps to reproduce (for bug reports)

TBD - example code appreciated

@yanchunhuo
Copy link
Author

somebody know?

@sonny-zhang
Copy link

因为Locust是采用requests库,所以使用requests.session可获取Cookies;
你可以在本地用python代码使用requests库的.session方法,先实验是否可用。

@yanchunhuo
Copy link
Author

@1fengchen1 我是说使用了geventclient库如何获取,不是requests库

@x1uk3z4ll
Copy link

FastHttpLocust use cookiejar to manager cookies, you can get cookies by self.cookiejar

self.cookiejar = CookieJar()

@yanchunhuo
Copy link
Author

@xinke2411 thanks

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

3 participants