Click here to Skip to main content
15,888,303 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I've asked a similar question before but still haven't got it solved yet, in C# I can simply create a WebClient and upload a string to my media web server and read the resultant data (JSON) thus ( I don't have a problem parsing the json )

C#
 WebClient client = new WebClient();
 String RawJson = client.UploadString("localhost:9000/jsonrpc.js",mydata);
// Job done.


Googling until I'm several shades of blue in the face has not helped me, for various reasons I need to do this in C or C++ and run it on an Android / Linux box ( mainly Android though ) Because of limitations in Android I can't use Casablanca or libcurl so need to do this without third party libraries , I know how to connect to localhost:9000 using sockets, but not how to then communicate with jsonrpc.js - I assume I have to write header information and all the dark stuff I don't know about - any help in achieving this would be fantastic - once I know how to send and receive the data I'll be up and running it's the first step I can't figure out ( this is a personal home project by the way )

What I have tried:

Googling until I'm several shades of blue in the face
Posted
Updated 29-Mar-16 21:55pm

1 solution

In C# your life is easy - someone wrote you a class that handle all the streaming of data between you and the web server...
Of course the original C++ libraries have no such class, but fortunately there are some who think you may need one...
CkUpload C++ Reference Documentation[^]

(Of course you can go and use the standard streaming libraries to write your own solution, but it may be a bit time consuming)
 
Share this answer
 
Comments
pkfox 30-Mar-16 11:06am    
The question is will it compile under my Android C++ compiler ? , I was thinking maybe it's possible using sockets - thanks for your help
Kornfeld Eliyahu Peter 30-Mar-16 11:15am    
Check here - http://www.chilkatsoft.com/chilkatAndroid.asp
pkfox 30-Mar-16 12:01pm    
That's a java example for Android - that's why I said in my original post I want a C/C++ solution - I've done lots of googling and seen all these libraries and they are no good to me - thanks anyway
Kornfeld Eliyahu Peter 30-Mar-16 13:16pm    
http://www.chilkatsoft.com/chilkatAndroidCpp.asp
http://www.example-code.com/cpp/default.asp
pkfox 31-Mar-16 2:07am    
Hi there looked promising but it's a commercial product which I don't want

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900