Sub Class_Globals
Private mResp As ServletResponse
Private ispost As Boolean
End Sub
Public Sub Initialize
End Sub
Sub Handle(req As ServletRequest, resp As ServletResponse)
Dim httpmethod As String = req.Method
mResp = resp
Dim j As HttpJob 'okhttp
j.Initialize("j", Me)
If httpmethod.ToLowerCase = "post" Then
ispost = True
j.Post...
Else
ispost = False
j.Download(...)
End If
StartMessageLoop
End Sub
Sub JobDone(Job As HttpJob)
If Job.Success Then
If ispost Then
File.Copy2(Job.GetInputStream, mResp.OutputStream)
Else
mResp.Write("< json string >")
End If
Else
mResp.SendError(500, Job.ErrorMessage)
End If
StopMessageLoop
End Sub