ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

http_string() SendStr Length & YAJLBuffer Limitations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • http_string() SendStr Length & YAJLBuffer Limitations

    I have a need to send an HTTP rest request where the header and body could exceed 100,000 characters. The procedure definition for http_string shows that the 3rd input parameter (SendStr) is defined as varchar(100000). In turn, http_string calls http_req, passing SendStr as the 6th parameter, which is defined as varchar(16000000). What are the implications behind customizing the SendStr definition in http_string() to be varchar(16000000) to match http_req?

    Also, will yajl_copyBuf puke if I yajl_addXXXX that much data?




  • #2
    I would recommend using http_req() instead of http_string() for data that large, just because of the performance benefit. Plus, this way you don't have to make modifications to HTTPAPI (which would be a pain in the butt, since you'd have to re-make them every time you upgraded versions -- but if you use http_req() which already supports data that large, you wouldn't need to do that.)

    For YAJL, the yajl_addChar() routine is limited in the size of the string you can add. However, yajl_addCharPtr() is not, it uses a pointer instead of a string, and allows for very large lengths. If you use yajl_addCharPtr() it should work fine.

    Comment

    Working...
    X