      SUBROUTINE PLW.BLD.HTTP.HDR(FLG,RESP,KA,TP,TMS,N,LL,EXTRA)
*PIC-LAN
*
*ALL
*PC
*N
*
*
*
*
      INCLUDE SYS.TYPE.INCLUDE
*
      INCLUDE PL.COMMON
      INCLUDE PL.COMMON.DEFS
      INCLUDE PL.DEFS
      INCLUDE PLIP.COMMON
      INCLUDE PLW.COMMON
*
      IF FLG THEN
         CTMS = VM
      END ELSE
         CTMS = PL_TODATE(PL_NOW()-PLIP$TZ)
      END
*
      LL = 'HTTP/1.0 ' : RESP : CRLF : 'Date: ' : CTMS : CRLF : 'Server: PicLan-IP ' : VER : CRLF
*
      IF KA THEN
         LL = LL : 'Connection: keep-alive' : CRLF
      END
      IF LEN(TMS) > 1 THEN
         LL = LL : 'Last-Modified: ' : TMS : CRLF
      END
      IF TP <> '' THEN
         LL = LL : 'Content-Type: ' : TP : CRLF : 'Content-Length: ' : N : CRLF
      END
*
      FOR I = 1 TO DCOUNT(EXTRA,VM)
         LL = LL : EXTRA<1,I> : CRLF
      NEXT I
*
      LL = LL : CRLF
*
      RETURN
   END
