How do you use cURL to authenticate on a Rails application that uses Devise?

后端 未结 4 772
温柔的废话
温柔的废话 2021-01-31 00:21

I want to test my rails web service using cURL, yet so far I could only do it while deactivating before_filter :authenticate_user!. But I\'d like to log in a priori

4条回答
  •  佛祖请我去吃肉
    2021-01-31 01:01

    Have you tried something like this (not tested):

    curl --user name:password http://www.domain.com
    curl --user name:password -f 'key=value' http://www.domain.com
    

提交回复
热议问题