c++ - Using GetHttpConnection in MFC -
i have rest server written in java , trying call method mfc client.
the server url http://localhost:8080/com.test.simpleservlet/api/customers , returns me proper value when run through crome postman plugin. have implemented java restful webservice server, com.test.simpleservlet servlet.
now trying implement client call url using mfc. sample code.
cstring strservername = l"http://localhost:8080/com.test.simpleservlet"; internet_port nport = 8080; pserver = session.gethttpconnection(strservername, nport); pfile = pserver->openrequest(chttpconnection::http_verb_get, l"/api/customers"); //strobject); pfile->sendrequest(); pfile->queryinfostatuscode(dwret);
i not able make work , error 12007(the server name not resolved) @
pfile->sendrequest();
i guess doing silly here, unfortunately not able figure out. not sure if serverurl passed correctly. had passed "http://localhost:8080/com.test.simpleservlet".
request kindly guide.
thanks sunil
it silly mistake. code should
cstring strservername = l"http://localhost"; ............. pfile = pserver->openrequest(chttpconnection::http_verb_get, l"/com.test.simpleservlet/api/customers");
Comments
Post a Comment