Forum Discussion

KentL's avatar
KentL
Visitor
14 years ago

AsyncPostFromString response body issue

The AsyncPostFromString function's events will only return the Response body if the HTTP Status Code = 200.

While this probably covers most scenarios, it *should* also return the response body for HTTP Status Code = 201 ("Created"). Currently, it does not. This is actually a pretty big omission since a 201 is a "more correct" response code for certain scenarios.

This one cost me a couple of hours so hopefully it helps someone (and hopefully we can get 201's added for future releases). 😉

2 Replies

  • I haven't tried this, but there is an (apparently undocumented) function RetainBodyOnError in ifUrlTransfer. Try calling xfer.RetainBodyOnError(true) before posting your request. Let me know if this works.

    --Mark
  • Thanks for the suggestion but it didn't work. It didn't raise an error, I just didn't get the response body. Looks like for now I can only return the 200 status. Can we get the 201 status code added for the next release?