SORU
28 Temmuz 2011, PERŞEMBE


Jersey: gerçek istek Yazdır

Nasıl sunucuya Jersey oluşturur ve gönderir gerçek bir istek görebilir miyim? Belirli bir istek ve adam tam web sunucusu isteği (başlıklar ve böyle görmek istedi koşu ile ilgili sorunlar yaşıyorum.

CEVAP
29 Temmuz 2011, Cuma


Sadece Jersey İstemci kullanıyorsanız API, LoggingFilter (istemci filtre) size yardımcı olacaktır:

Client client = Client.create();
client.addFilter(new LoggingFilter(System.out));
WebResource webResource = client.resource("http://localhost:9998/");
ClientResponse response = webResource.accept(MediaType.APPLICATION_JSON)
                                         .get(ClientResponse.class);

Aksi halde, yine de istek günlüğü ve diğer sunucu kullanarak yanıt verebilirsiniz LoggingFilter (konteyner filtre).

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Chip Johnson

    Chip Johnson

    30 AĞUSTOS 2007
  • L33TNoonProductions

    L33TNoonProd

    24 EYLÜL 2010
  • REK Roth Productions

    REK Roth Pro

    8 Ocak 2011