Guest User

Untitled

a guest
Feb 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. request.accept = "application/json"
  2.  
  3. get '/my/path'
  4.  
  5. get '/my/path.json'
  6.  
  7. get '/my/path', nil, {'HTTP_ACCEPT' => "application/json"}
  8.  
  9. @request.env['HTTP_ACCEPT'] = "*/*, application/youtube-client"
  10. get :index
  11.  
  12. header 'X_YOUR_HEADER_VAR', 'val'
  13. get '/path'
  14.  
  15. get :index, :format => 'json'
  16.  
  17. request.headers["Accept"] = "application/json"
  18.  
  19. {"Accept" => "application/json"}
  20.  
  21. headers = { "HTTP_ACCEPT": "application/json" }
  22. get my_path, xhr: true, headers: my_headers
  23.  
  24. post :save, {format: :json, application: {param1: "test", param2: "test"}}
Add Comment
Please, Sign In to add comment