list_libraries Subroutine

private subroutine list_libraries(this, language_id)

Uses

    • http
  • proc~~list_libraries~~UsesGraph proc~list_libraries forcompile::compiler_explorer%list_libraries http http proc~list_libraries->http

Type Bound

compiler_explorer

Arguments

Type IntentOptional Attributes Name
class(compiler_explorer), intent(inout) :: this
character(len=*), intent(in), optional :: language_id

Calls

proc~~list_libraries~~CallsGraph proc~list_libraries forcompile::compiler_explorer%list_libraries request request proc~list_libraries->request

Contents

Source Code


Source Code

   subroutine list_libraries(this, language_id)
      use http, only: response_type, request
      class(compiler_explorer), intent(inout) :: this
      character(len=*), intent(in), optional  :: language_id
      type(response_type)                     :: response

      if (present(language_id)) then
         response = request(url=this%api_url//'/api/libraries/'//trim(language_id))
      else
         response = request(url=this%api_url//'/api/libraries')
      end if
      if(.not. response%ok) then
         print *,'Error message : ', response%err_msg
      else
         print *, 'Response Content : ', response%content
      end if
   end subroutine list_libraries