1. Куча / Говнокод #24606

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    POST-запрос на "Java":
    
    import org.apache.http.*;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.entity.UrlEncodedFormEntity;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.message.BasicNameValuePair;
    import org.apache.http.protocol.HTTP;
    import java.util.ArrayList;
    import java.util.List;
    import java.io.UnsupportedEncodingException;
    import java.io.IOException;
    
    Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
    try  {
    try {
    HttpClient client = new DefaultHttpClient();
    HttpPost post = new HttpPost("http://example.com/form/");
    List<NameValuePair> pairs = new ArrayList<NameValuePair>();
    pairs.add(new BasicNameValuePair("test", "test"));
    pairs.add(new BasicNameValuePair("test2", "test2"));
    post.setEntity(new UrlEncodedFormEntity(pairs));
    try {
    HttpResponse response = client.execute(post);
    } catch (IOException e) {}
    } catch (UnsupportedEncodingException e) {}
    } catch (Exception e) {}
    }
    });
    
    
    
    POST-запрос на "PHP":
    
    $postdata = http_build_query(array('test' => 'test', 'test2' => 'test2'));
    $opts=array('http'=>array('method'=>'POST', 'header'=>'Content-type: application/x-www-form-urlencoded', 'content'=>$postdata));
    $result=file_get_contents('http://mv4gc3lqnrss4y3pnu.cmle.ru/form/', false, stream_context_create($opts));

    Запостил: 20_BLACK_CENTIMETERS, 10 Августа 2018

    Комментарии (24) RSS

    Добавить комментарий