import com.google.gson.Gson; import java.io.IOException; import java.io.UnsupportedEncodingException; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.DefaultHttpClient; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import org.apache.http.client.methods.HttpGet; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.entity.StringEntity; /** * * @author Ewrei *///Ошибка class ErrorObj { long code; String message; } //Отправка телефона class pojo1 { int id; public void setId(int p) { id = p; } //generate setter and getters } public class PovtornayOtpravka { public static HttpClient verifiedClient(HttpClient base) { try { SSLContext ctx = SSLContext.getInstance("SSL"); X509TrustManager tm = new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {} @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {} }; ctx.init(null, new TrustManager[] { tm }, null); SSLSocketFactory ssf = new SSLSocketFactory(ctx, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); ClientConnectionManager mgr = base.getConnectionManager(); SchemeRegistry registry = mgr.getSchemeRegistry(); registry.register(new Scheme("https", 443, ssf)); return new DefaultHttpClient(mgr, base.getParams()); } catch (Exception ex) { ex.printStackTrace(); return null; } } public static void main(String[] args) throws UnsupportedEncodingException, IOException { pojo1 poj = new pojo1(); poj.setId(159184727); Gson gson2 = new Gson(); StringEntity postingString = new StringEntity(gson2.toJson(poj)); String url = "https://protaxi-brest.hivelogin.ru:443/api/client/mobile/1.0/registration/resubmit&id=" + poj.id; HttpClient client = new DefaultHttpClient(); client = verifiedClient(client); HttpGet post = new HttpGet(url); HttpResponse response = client.execute(post); //final GitPolz polz = gson.fromJson(response.getEntity().(), GitPolz.class); System.out.println("Response Code : " + response.getStatusLine().getStatusCode()); //String httpResponse = EntityUtils.toString(response.getEntity()); } } 

Closed due to the fact that off-topic participants Mikhail Vaysman , post_zeew , YuriiSPb , Artem Konovalov , user194374 15 Feb '17 at 10:10 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is closed, as it is customary to ask questions in Russian only on Russian in Stack Overflow . Please translate your question into Russian or use Stack Overflow in English ." - Mikhail Vaysman, post_zeew, YuriSPb
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Welcome to StackOverflow in English. As the name implies, this site. Please either translate the question in English . If you choose to translate it. Questions are usually asked in Russian. - Mikhail Vaysman
  • Perhaps you will have to shaman with url encode - Kleimosc
  • But the text of the error should not be translated) - vp_arth

1 answer 1

String url = "https://protaxi-brest.hivelogin.ru:443/api/client/mobile/1.0/registration/resubmit&id=" + poj.id;

You pass a parameter incorrectly.

The parameter line should be separated from the query path by a question mark:

 http://example.org/path?param=value&param2=value2 

Try this:

 String url = "https://protaxi-brest.hivelogin.ru:443/api/client/mobile/1.0/registration/resubmit?id=" + poj.id;