I’m trying to use HttpClient in my Cocos2d-x project. I’m using cocos2d-x 3.8 and developing with Xcode.
Some things I tried to do:
-
I was looking cocos-ext.h file and I saw network was removed. In this thread explains that it was moved to core: Why remove network on cocos2d-x 3.0 beta?
-
I saw in network/HttpAsynConnection-apple.h there are two namespaces declared, cocos2d and network
-
When I add this to my code the compiler says: no member named ‘network’ in namespace ‘cocos2d’
cocos2d::network::HttpRequest* request = new cocos2d::network::HttpRequest();
Probably I’m missing something? I need to add any preprocessor macro to enable network? Some param in c++ compiler to enable sub-namespaces?
I read all documentation here, in cocos2d-x.org and Stackoverflow with no success.
Thank you very much!