Request.Entity doesn't work in Web 2.0 / API 2.0

In 2019R3.1 we would use Request.Entity & Request.Print. But, trying to convert to 2020R1.2 these functions don’t work. How do we convert this?

Thanks!

You’ll notice that there’s now a response parameter. You should write your values there.

Since the documentation has no examples, how do I do this? (sorry that I’m not experienced enough to know)

The same way you did it in web 1. Just replace request with response.

There’s also an example called “WebService-HandleUrl”

Thanks, I’ll take a look.

Ok. So, I see how to change Request.Print to Response.Write. But, I have no idea how to change Request.Entity to anything equivalent in Web 2. Help?

We’re you writing to entity before?

 Request.Body As String

Should be the equivalent, it’s read only:
https://documentation.xojo.com/api/web/webrequest.html

I see there is no way to read the WebResponse.Write value after setting it. This could be done in Web 1.0, are you looking for such functionality?

1 Like

No writing, reading - Request.Entity

Wish there was some kind of Before -> After chart for Web 1 -> Web 2, and possibly for API 1 -> API 2. That sure would take a LOT of the guess work and time out of trying to get a HUGE web project converted over.

Thanks for your consideration.

1 Like

No, just need to read the incoming data.

Read the Request.Body in Web 2.0

Then just use Request.Body.

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