apis/piazza_api.rb
# Piazza api call wrapper - returns a JSON object
Piazza api call wrapper - returns a JSON object
Piazza api call wrapper - returns a JSON object
def apiCall(data)
    uri = @uri.dup
    request = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')
    request['Cookie'] = @cookies
    request['CSRF-Token'] = @session_id
    request.body = data.to_json
    response = @https.request(request)   
    JSON::parse(response.body, :symbolize_names => true)
  end
def apiCall ( data ) uri = @uri . dup request = Net :: HTTP :: Post . new ( uri . path , 'Content-Type' => 'application/json' ) request [ 'Cookie' ] = @cookies request [ 'CSRF-Token' ] = @session_id request . body = data . to_json response = @https . request ( request ) JSON :: parse ( response . body , :symbolize_names => true ) end
Piazza api call wrapper - returns a JSON object
Piazza api call wrapper - returns a JSON object
data
<not_specific>