C Collection of code snippets by Arne Vajhøj 
C (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
      program p5
      implicit none
      call test('arne1',12345,'/');
      call test('arne1',12346,'/');
      end
c
      subroutine test(host,port,path)
      implicit none
      character*(*) host,path
      integer*4 port
      character*100 outmsg,inmsg
      integer*4 con
      integer*2 msglen
      integer*4 vms_http_post,vms_http_recv,vms_http_numcode
c  connect and write request message
      outmsg='Hi from Fortran!'//char(13)//char(10)
      msglen=len('Hi from Fortran!'//char(13)//char(10))
      con=vms_http_post(%descr(host),%ref(port),%descr(path),
     +  %descr('text/plain'),%descr('*/*'),
     +  %descr(outmsg(1:msglen)))
c  read response message
      if(vms_http_numcode(con).eq.200) then
100     if(vms_http_recv(con,inmsg,msglen).ge.0) then
          write(*,*) inmsg(1:msglen)
          goto 100
        end if
      else
        write(*,*) 'HTTP error: ',vms_http_numcode(con)
      end if
c  disconnect
      call vms_http_close(%ref(con))
      return
      end
