Panoramax.cgi and json

How does panorama.cgi handle a post of json data?

Unless PanX has some new ability I haven’t discovered, raw JSON won’t get you anywhere. For starters, the server software won’t know to hand it off to Panorama. You’d need to embed it in a hit to panorama.cgi as post data that Pan Server can then pick apart and process. Within the post data it can certainly retain the usual JSON formats.

Thank you James, It would be great if I could send it as plain text, then in Panorama on the server convert it to a dictionary if necessary and then do as I please with it.

I’m not sure if I understand the original question. I don’t see any reason why you can’t send JSON as a post argument – it’s just text. On the other hand, I’m not sure what the advantage would be unless you already had JSON handy on the client side.

You are correct Jim, the only advantage is that a client side javascript library Im playing with uses json for web component formatting and data populating. The thing that is interesting to me about this is that it separates the data from the web interface in a way the helps my brain keep things organized. Panorama Server would just need to supply json, which it does beautifully and simply by the way, and then receive the changed or new data in a json format to update the database. I know that taking a json file, converting to a dictionary then dumping the dictionary and executing the results can update the database very easily as well. I just dont know if panoramax.cgi would transparently pass the json with out trying to process it like it does with web form items.

Transparently pass it to what? (Don’t answer, that was a rhetorical question.)

The HTTP format specifies that data is uploaded to the server using the POST protocol. This allows different data items to be uploaded by name.

You can’t simply use JSON instead of the POST protocol. I don’t think any web server would allow that, that is not HTTP compliant. Also I don’t think you can submit that from a web browser or from JavaScript. But there is no reason you can’s simply pass a single POST item, and have that item contain JSON. If you like, you could call that item JSON (though it could be any name you want, as long as your client and server software agree). As far as panoramax.cgi is concerned, text is text, it will always pass it thru. It doesn’t know or care that it happens to contain a JSON payload.