Need help converting API 1.0 to 2.0

I have not been able to convert this event to API 2.0

Function HandleSpecialURL(Request As WebRequest) Handles HandleSpecialURL as Boolean

dim cloud As new CloudSpecialURL
Request.Print(cloud.Process)
Return True
ElseIf instr(request.Path, “verify”) > 0 then
cloud.Verify
Return True
end if
End Function

The best I have come up with is

Function HandleURL(Request As WebRequest, Response As WebResponse) Handles HandleURL as Boolean
dim cloud As new CloudSpecialURL
cloud.js = New JSONItem(Request.Body)
if instr(request.Path, “process”) > 0 then
dim a As string = cloud.Process
Request.Parameter(cloud.Process)
Return True
ElseIf instr(request.Path, “verify”) > 0 then
cloud.Verify
Return True
end if
End Function

“cloud.Process” processes a JSONItem and returns a JSON string to be returned to the sender. The bold line returns an error that says “This method cannot accept an assigned value (it lacks an Assigns parameter).” I believe I am doing what the LR says for WebRequest, but it is not working for me.

Web 2 introduces response for responding to a handle url request doesn’t reuse request like 1.0.

Thanks Wayne

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.