|
-
Mar 14th, 2022, 02:43 PM
#1
Thread Starter
Member
convert Java to vb6.0
Can someone convert the following code in JAVA to vb6.0 ?
// Apache HTTP client is used from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class Java1
{
public static void main(String[] args)
{
HttpClient httpclient = HttpClients.createDefault();
try
{
URI-1 builder = new URI-1("https://data1-api.net/Request1");
builder.setParameter("code", "{code}");
URI uri = builder.build();
HttpGet request = new HttpGet(uri);
request.setHeader("ID", "{ID}");
request.setHeader("Key", "{key}");
StringEntity reqEntity = new StringEntity("{body}");
request.setEntity(reqEntity);
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null)
{
System.out.println(EntityUtils.toString(entity));
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
Last edited by dimbil; Mar 14th, 2022 at 02:52 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|