Package br.com.caelum.restfulie.http

Examples of br.com.caelum.restfulie.http.DefaultRestClient


public class LinkTest {

  @Test
  public void shouldUseTheMediaTypeProviedByTheUser() {
    DefaultRestClient restfulie = new DefaultRestClient();
    Request request = restfulie.at("uri").as("application/xml");
   
    assertThat(request.getHeaders().get("Content-type"),is(equalTo("application/xml")));
  }
View Full Code Here


    FormEncoded encoded = new FormEncoded();
    StringWriter writer = new StringWriter();
    Map<String, String > params = new HashMap<String, String>();
    params.put("name", "Guilherme");
    params.put("age", "29");
    encoded.marshal(params, writer, new DefaultRestClient());
   
    assertThat(writer.toString(), Matchers.anyOf(is(CoreMatchers.equalTo("name=Guilherme&age=29")),
        is(CoreMatchers.equalTo("age=29&name=Guilherme"))));
  }
View Full Code Here

  /**
   * Entry point to configure serialization data prior to accessing the resources.
   */
  public static RestClient custom() {
    return new DefaultRestClient();
  }
View Full Code Here

  /**
   * Entry point to configure serialization data prior to accessing the resources.
   */
  public static RestClient custom() {
    return new DefaultRestClient(new CachedEnhancer(new DefaultEnhancer()));
  }
View Full Code Here

 
  /**
   * Entry point to configure the configuration to serialize serialization data prior to accessing the resources of the resources. AAAAAAAAAAAAW YEAH.
   */
  public static RestClient custom(Enhancer enhancer) {
    return new DefaultRestClient(enhancer);
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.restfulie.http.DefaultRestClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.