Sha256: c3c0c0cdbfbdc585ca4da507fe2f5ebfa545d1457d98c53e8b2d2f4296ba6dd7

Contents?: true

Size: 590 Bytes

Versions: 4

Compression:

Stored size: 590 Bytes

Contents

# GET request
get '/sample26' do
  haml :sample26
end

# POST request
post '/sample26' do
  set :email, params[:email]
  set :password, params[:password]


  begin
    # check required variables
    raise 'Please enter all required parameters' if settings.email.empty? or settings.password.empty?

    # make a request to API using email and password
    user = GroupDocs::User.login!(settings.email, settings.password)

  rescue Exception => e
    err = e.message
  end

  # set variables for template
  haml :sample26, :locals => {:user => user, :err => err}
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
groupdocs-1.5.7 examples/api-samples/samples/sample26.rb
groupdocs-1.5.6 examples/api-samples/samples/sample26.rb
groupdocs-1.5.5 examples/api-samples/samples/sample26.rb
groupdocs-1.5.4 examples/api-samples/samples/sample26.rb