Rails HTTParty Getting Timeout::Error

落爺英雄遲暮 提交于 2019-12-04 20:18:42

If I understand correctly, you have an API end-point, at /api/v1/users, and your BaseController#index is calling that method?

If that is correct, inside the same rails process, and you are testing in development mode (as I can tell from your url), then you only have a single process running, which can only handle a single request at once. So if you start a request to BaseController#index, it will start another request to your own test-server, which is busy, and it will just wait until it times out.

If you want to test your API, I would look at a client tool like e.g. Postman.

HTH.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!