Posible bug in Dictionary blocks

Is this correct?

Remove the trailing colon ( : ) from the text block containing "Content-Type"

It is corrupting the JSON conversion.

What is strange to me is what the Do-it window shows. I

A

There is a V in the text shown that it is not in the vague space of the block

Value space. By the way, I remove the colon as suggested but the misterious V is still there

Can you show the new Do It, after removing the old one?

If you do a Download Blocks Image on that procedure and post it uneditted, I can drag it into my Blocks Editor.

By the way, this is typically done as a list of lists, not a dictionary.

blocks

You're right, it's reproducible.

I can't explain where the \ came from.

Best to avoid all that with a list of lists.

P.S> I'm reclassifying this as a bug, until I hear a good explanation.

Ok. Thanks. I already did change for a list of lists.

Regards

This \ is called escape, normally for special characters, not a bug.

4 Likes

Yes, \ is an escape character in many contexts.

I am concerned about the characterisation of / as a special character in the context of json.

I don't remember seeing it used as a json wrapper.
JSON JSON
(Okay, it's an official json escapable character at json.org)

It's also not a CSV wrapper.

It's probably more used in XML, in closing brackets </...>

So that makes me wonder if downstream processing of Web Get headers accomodate \ escape characters versus just passing them along for application code to choke on.

To avoid taking the grand tour of AI2 data types, check tool tips:

Thank you for the explanation for the origin of the character “escape”. What I can tell is that in the context and usage of the dictionary blocks to form Request Headers, the apperance of the “scape” character make that the use of a REST API call to be considered a wrong and isntead of a responce you get an error. The most interesting thing in this story is that if used in an android app everithing works OK. But if the call is in a iOS app under the corresponding companion you do not even have an error message.

In my case, I change to the recomended use of making a list of lists and like magic, the REST API call to Gemini worked just fine.

Thans a lot for your valuable comments an suggestions.

regards