Web App - Returned Data Not As Expected

Hello Experts,

I’m a FileMaker developer and new to the Xojo framework. I’m developing an iOS app and a Web app with Xojo for connecting with a FileMaker runtime application. The Web App serves as the “middleware” for storing information sent by the IOS app for later retrieval by the Filemaker app. Conceptually, it’s pretty simple. Everything is working as designed but one thing. When the Filemaker app posts a request to the Xojo web app, the information returned is not in JSON format but shows up as garbage characters (compression?). I assume it is getting compressed on the web side. I am using the HandleSpecialURL Event handler in which there is a “Request.Print(output)” command. “output” is JSON text. How do I disable the compression? Should I be doing this differently? Thanks for your help.

Adam

define “garbage”?
could it be a misinterpetion (or missing) character encoding?

How do you post to the web app ?

[quote=238373:@Dave S]define “garbage”?
could it be a misinterpetion (or missing) character encoding?[/quote]

Dave – here are the characters:
ãmê¡j?0DeN=zì(§Bh”K)!¥†Xì?T?iu??GâÈ?Ïm?όÏöNá`MGÁ?—^Ìvµ›·–a‚3*±å?»Çå,¬sÙs?¸Ø?}3ŸØéHºf•«˜ÈO??Eڃ?wA?©o?‚Læ:u EeK?´Ûô?‹Õe]&?éÌ/ÊX“?b?—C” ˜„?±12’T r˜7ÏâCTbÔ}bŒ;¨7œÕ™÷?H•?,?»„78>=?

The test Json I’m retrieving is short.

Michel – I’m posting to the app using the Filemaker MBS CURL functions:

MBS(“CURL.SetOptionURL”; $curl;“http://127.0.0.1:14065/special/GetEmployeeData”)
MBS( “CURL.SetInputText”; $curl; $$EmployerID; “UTF-8” )
MBS(“Curl.Perform”; $curl)
MBS(“CURL.GetResultAsText”; $curl)

The $$EmployerID is the Primary Key used to retrieve the data from the Web App’s SQLite dbase. This works correctly.

Thank you both for the quick responses.

The gibberish you posted does not look like an encoding issue. I guess Christian Schmitz will be able to help with the MBS plugin.

Thank you. I reached out to Christian to see if he can help.

The output is probably gzipped.

Greg – that was my original belief. Is there a way to stop the Xojo output from being compressed? Thanks for your help.

It should only be compressing the data if the socket that is connecting told us that it can handle gzipped content. If it’s not, that’s a bug and you should file a report.

Edit: I just checked the code. The only way that this would be happening is if the client (in this case Filemaker) was including a header saying that it accepts gzipped content. e.g.

Accept-Encoding: gzip

If that’s the case, it’s telling us that it expects a compressed response.

[quote=238465:@Greg O’Lone]It should only be compressing the data if the socket that is connecting told us that it can handle gzipped content. If it’s not, that’s a bug and you should file a report.

Edit: I just checked the code. The only way that this would be happening is if the client (in this case Filemaker) was including a header saying that it accepts gzipped content. e.g.

Accept-Encoding: gzip

If that’s the case, it’s telling us that it expects a compressed response.[/quote]

Thank you for this. I will look into it.

Adam