lib/modules/aspace_utilities.rb
# Perform a GET request to ArchivesSpace
# Returns response body as Ruby hash, or nil
Perform a GET request to ArchivesSpace
Returns response body as Ruby hash, or nil
Perform a GET request to ArchivesSpace Returns response body as Ruby hash or nil
def aspace_api_get(uri, params={}, headers={})
    @a = ArchivesSpaceApiUtility::ArchivesSpaceSession.new
    response = @a.get(uri, params, headers)
    if response.code.to_i == 412
      @a = ArchivesSpaceApiUtility::ArchivesSpaceSession.new
      response = @a.get(uri, params, headers)
    end
    if response.code.to_i == 200
      JSON.parse(response.body)
    else
      nil
    end
  end
def aspace_api_get ( uri , params = { } , headers = { } ) @a = ArchivesSpaceApiUtility :: ArchivesSpaceSession . new response = @a . get ( uri , params , headers ) if response . code . to_i == 412 @a = ArchivesSpaceApiUtility :: ArchivesSpaceSession . new response = @a . get ( uri , params , headers ) end if response . code . to_i == 200 JSON . parse ( response . body ) else nil end end
Perform a GET request to ArchivesSpace
Returns response body as Ruby hash, or nil
Perform a GET request to ArchivesSpace Returns response body as Ruby hash or nil
# Response code 412 from ArchivesSpace API indicates a problem with the authenticated session # The cause of this is unclear, but re-connecting seems to address the problem (2017-02-15)
uri
<not_specific>
params
<not_specific>
headers
<not_specific>