1
\$\begingroup\$

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?

\$\endgroup\$
1

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ That was perfect, every time I searched for network help it only came back with information about the Network class. Thanks. \$\endgroup\$
    – Bobbake4
    Nov 21, 2011 at 19:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .