我正在使用 gem'devise_token_auth' gem'gcparty'。
在发布操作后,我想从响应中获取ff标头:
示例: HTTParty.post(“/ auth / sign_in”,@ options)
我需要:
access_token: response.headers['access-token'],
client: response.headers['client'],
expiry: response.headers['expiry'],
token_type: response.headers['token-type'],
uid: response.headers['uid']
请帮忙!
答案 0 :(得分:0)
您可以访问HTTParty以这种方式返回的标题:
require 'httparty'
response = HTTParty.post("/auth/sign_in", @options)
puts response.headers
您还可以在此处查看示例:https://johnnunemaker.com/httparty/