IBM Support

Limitations of NotesHTTPRequest and NotesJSONNavigator with future considerations

Technical Blog Post


Abstract

Details the current known limitations of the NotesHTTPRequest and NotesJSONNavigator classes and upcoming changes to remove those limitations

Body

First, in Notes/Domino 10.0.1 FP1 is the fix for NotesJSONNavigator getNthElement not obeying boundaries which was reported under SPR  SKSWB89MGH

Next, there have been some limitations found in the NotesHTTPRequest and NotesJSONNavigator classes which are reported under these SPRs:
  • DCONB8VMAV - NotesJSONNavigator is unable to parse JSON content > 64k
  • ASHEB95LFR - Unable to parse JSON string: Missing a name for object member, offset 1
  • DCONB8F6JV - bad character conversion happening in NotesHTTPRequest response
  • ASHEB95LFR - NotesJSONNavigator unable to navigate a string which contains new lines and carriage returns
  • DCONBB2KNR - NotesJSONNavigator experiencing severe issues when parsing packages with empty string values
  • JCORBB2KWU - Unable to Post > 64K String in NotesHTTPRequest
  • DCONBB44T4 - Creating a NotesJSONNavigator from nulled response causes crash

In the 10.0.1 FP2 release of Notes/Domino we'll be introducing two new properties in the NotesHTTPRequest class: PreferUTF8 and PreferJSONNavigator. We are not going to change the default behavior, so if you are fine using the class as it is in a previous release you may continue.

However, if you have experienced any of the issues above, it is recommended to start setting NotesHTTPRequest.PreferJSONNavigator = True before making your request.

If you update your script to return the NotesJSONNavigator as the response, LotusScript requires that a variable which is being instantiated from an object requires that you use SET to assign a value to that variable. If you do not use SET you'll the error of "SET required on class instance assignment" (see here).

An example of the behavior versus the new:

10.0.1 behavior:
Dim session As New NotesSession
Dim httpreq As NotesHTTPRequest
Dim jsonNav as NotesJSONNavigator
Dim response as Variant

Set httpreq = session.CreateHTTPRequest()
response = httpreq.get("http://my.testapi.com/endpoint")

Set jsonNav = session.CreateJSONNavigator(response)

Dim jsonElem as NotesJSONElement
Set jsonElem = jsonNav.getFirstElement()
...

10.0.1 FP2 behavior with PreferJSONNavigator = True:
Dim session As New NotesSession
Dim httpreq As NotesHTTPRequest
Dim jsonNav as NotesJSONNavigator

Set httpreq = session.CreateHTTPRequest()
httpreq.PreferJSONNavigator = True
Set jsonNav = httpreq.get("http://my.testapi.com/endpoint")

Dim jsonElem as NotesJSONElement
Set jsonElem = jsonNav.getFirstElement()
...

We hope this makes your experience with the new classes better and you are now able to use them to their full potential. We did not change the default behavior as we cannot break scripts which are working fine and given the change in behavior to needing to use SET we would have caused everyone a big headache in needing to update their scripts to the new behavior.

TAGS

lotusscript, noteshttprequest, notesjsonnavigator, notesjsonobject, notesjsonarray, notesjsonelement


Cross reference information
Product Component Platform Version Edition
IBM Notes Mac OS, Windows 10.0.1 FP2

Document information

More support for: IBM Domino

Software version: 10.0.0, 10.0.1

Operating system(s): Linux, Mac OS, Windows

Reference #: 0875724

Modified date: 23 May 2019