How to pass parameter to a HTTP get request?
johirbuet opened this issue · 2 comments
I want to get data from host by http get request. With some parameters.
When i type the url in the browser http://shaka-engine.refuel4.com/cv/image/meta_data/?s3_image_file_name=refuel4-shaka2/data/taipei101.jpg&target_countries=&output_indent_level
I get response.
But in the following code
String hosts="http://shaka-engine.refuel4.com/cv/image/meta_data?s3_image_file_name=refuel4-shaka2%2Fdata%2Ftaipei101.jpg&target_countries=&output_indent_level=";
ParallelClient pc = new ParallelClient();
pc.prepareHttpGet("")
.setConcurrency(1)
.setTargetHostsFromString(hosts)
.execute(new ParallecResponseHandler() {
public void onCompleted(ResponseOnSingleTask res,
Map<String, Object> responseContext) {
System.out.println(res.getResponseContent());
}
});
pc.releaseExternalResources();
It shows me exception
java.net.UnknownHostException: s3_image_file_name=refuel4-shaka2
What is the reason? How can i pass parameter to an url
@johirbuet thanks for trying Parallec!
hosts please put: shaka-engine.refuel4.com
to the target host
put the rest in
.prepareHttpGet("/cv/image/meta_data?s3_image_file_name=refuel4-shaka2%2Fdata%2Ftaipei101.jpg&target_countries=&output_indent_level=")
please refer to:
- http://www.parallec.io/docs/api-overview/
- http://www.parallec.io/docs/submit-task/#apis-on-http
- http://www.parallec.io/docs/submit-task/#set-target-hosts
thanks
close it for now . feel free to reopen it.