Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have looked at the network documentation for Unity and most examples seem to be related to networking your game for multiplayer. I am just looking to grab a JSON response from an API for dynamically generating a menu.

Are there some good examples for doing just simple network calls to get a response from a web server?

share|improve this question
    
Please don't cross-post. meta.stackexchange.com/questions/64068 stackoverflow.com/questions/8216127 –  Jimmy Nov 21 '11 at 18:22
add comment

1 Answer 1

up vote 2 down vote accepted

You go through the WWW class.

http://unity3d.com/support/documentation/ScriptReference/WWW.html

You can do a GET or POST through that, and get the .text from the result when it finishes downloading. There are several C# JSON decoders that you can use instead of parsing the result yourself.

share|improve this answer
    
That was perfect, every time I searched for network help it only came back with information about the Network class. Thanks. –  Bobbake4 Nov 21 '11 at 19:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.