Pass JSON in protocol handler

Pass JSON in protocol handler

Anonymous
Not applicable
716 Views
4 Replies
Message 1 of 5

Pass JSON in protocol handler

Anonymous
Not applicable

Basically, I want to do the following:

  1. Pass IDs for projects, folders, and files in the properties of the protocol handler
  2. Pass some data in the same place
  3. Parse that JSON in the Fusion App and then open those files and apply that data

My issue is that the JSON decoder keeps giving me an error and I can't figure out why. Any recommendations for passing JSON in the protocol handler?

0 Likes
Accepted solutions (1)
717 Views
4 Replies
Replies (4)
Message 2 of 5

JesusFreke
Advocate
Advocate

What error are you seeing? And what is the json input that is generating the error?

0 Likes
Message 3 of 5

Anonymous
Not applicable

I load the json library and then attempt to use the json.loads command. It just gives me an exception that there was an issue parsing that data.

 

I have tried a few ways to pass the JSON data, but I believe that the problem is that I replace the double quotes used for the JSON object with single quotes so that I could pass the data in the protocol handler without issues.

0 Likes
Message 4 of 5

JesusFreke
Advocate
Advocate

If you want us to help you, to have to give us enough details to be able to help you :).

 

When you are trying to get help with a specific error, you should include the exact error message you are receiving. And when it's something like this, it's best to include the input that is causing the error as well.

0 Likes
Message 5 of 5

Anonymous
Not applicable
Accepted solution

OK. So I am working in the Spyder IDE. I have a print command to output a part of the dict that is created when the JSON was parsed. However, that print would never happen so I assumed that there was an error. Whenever I would hit enter in the console, there was an error there as well.

 

What I eventually discovered is that the print just doesn't happen, but I can make it happen when I hit enter in the console. Not sure why this is.

0 Likes