NetTalk Central

Author Topic: NTWS '#' character trucates json param string  (Read 902 times)

davbrat

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
NTWS '#' character trucates json param string
« on: August 31, 2023, 09:57:29 AM »
[NT 14 Webservice] I'm trying to create a Cognito Reports CallBack Server that receives a json string. It has no parameter tag so I can't use the template variable, I use p_web.wholeurl to grab the passed json and I store it in a StringTheory object. So far so good. 

Here is my problem...  there is a '#' in all of the link data strings.  If they are in the string the incoming parameter string truncates at its location.  I can't remove it prior to it being sent by the other vendor.  Those links are needed to get access to the report.

[example of a link with a '#' in it]

<lots of json in front>,"EditLink":"https://www.cognitoforms.com/SamplePayrollInc/AuxiliaryProductsRequest#RsoPs0JdqAxUKC3gCS_JD_l5zxTsRtOP8Zo7mA78yz64$*", <more json links>

 so the incoming json string that makes it to my proc looks like

 <lots of json in front>,"EditLink":"https://www.cognitoforms.com/SamplePayrollInc/AuxiliaryProductsRequest

The second half of the link as well as all the rest of the json structure that follows is gone.

I have 8 document "link" string structures and they all have a '#' in them.

How do I get the '#' to be ignored and stop truncating the incoming string?  I'm not seeing anything in the docs that relates to this issue.  It has been many years since I fiddled with NT server side. So I don't really know where to hit it with a hammer.

TIA,

Dave


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile
Re: NTWS '#' character trucates json param string
« Reply #1 on: August 31, 2023, 10:06:11 PM »
So, a client will literally "not send" everything after the #. Basically in the format of a URL everything before the # is sent to the server, and everything after the # is "information for the browser on what to do when the reply arrives".

So in this case the link gets a page (https://www.cognitoforms.com/PayrollPeopleInc/AuxiliaryProductsRequest) which is fetched by the browser, and then the # part (known as the "anchor") "jumps" to that part of the page when it arrives.

So my first question to you becomes - if you look in the NetTalk log, is the part after the # in there? ie does that appear as part of the incoming URL?

davbrat

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: NTWS '#' character trucates json param string
« Reply #2 on: September 01, 2023, 02:28:42 PM »
It was all my fault, bad formatting coming in from the test client apps.  After dumping the trash, it is now working as expected. 

Thanks Bruce for all your help on this.

<I'll go stand in the corner for an hour  :( >