package com.bitvault.net;

import com.github.kevinsawicki.http.HttpRequest;

public class HttpClient {

	private String apiToken;
	
	public HttpClient(String apiToken) {
		this.apiToken = apiToken;
	}
	
  public String get(String url, String accept) {
	 
    String response = HttpRequest.get(url)
    		.accept(accept)
    		.authorization(this.authorization())
    		.body();
    return response;
  }
  
  public String post(String url, String accept, String contentType, String body) {
    String response = HttpRequest.post(url)
    		.contentType(contentType)
    		.accept(accept)
    		.authorization(this.authorization())
    		.send(body)
    		.body();

    return response;
  }

  private String authorization() {
	  return "BitVault-Token " + this.apiToken;
  }
}
@@ -482,35 +482,36 @@
 body) %7B%0A
-    String response
+%09HttpRequest request
  = HttpR
@@ -531,44 +531,9 @@
 rl)%0A
-    %09%09.contentType(contentType)%0A    
+%09
 %09%09.a
@@ -538,36 +538,33 @@
 .accept(accept)%0A
-    
+%09
 %09%09.authorization
@@ -589,42 +589,118 @@
 n())
-%0A    %09%09.send(body)%0A    %09%09.
+;%0A%09%0A%09if (contentType != null)%0A%09%09request.contentType(contentType);%0A%09%0A%09if (body != null)%0A%09%09request.send(
 body
-(
 );%0A
+%09
 %0A   
@@ -709,28 +709,36 @@
 eturn re
-sponse
+quest.body()
 ;%0A  %7D%0A
+  
 %0A  priva

make content type and body optional