Subversion Repositories eFlore/Applications.coel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
463 jp_milcent 1
package org.tela_botanica.client.http;
2
 
846 gduche 3
import org.tela_botanica.client.Mediateur;
4
 
463 jp_milcent 5
import com.google.gwt.core.client.GWT;
6
import com.google.gwt.http.client.Request;
7
import com.google.gwt.http.client.RequestBuilder;
8
import com.google.gwt.http.client.RequestCallback;
9
import com.google.gwt.http.client.RequestException;
10
 
11
public class JsonRestRequestBuilder extends RequestBuilder {
12
 
13
	public JsonRestRequestBuilder(Method httpMethod, String url) {
14
		super(httpMethod, url);
15
		// TODO Auto-generated constructor stub
16
	}
17
 
18
	public Request envoyerRequete(String donneesRequete, RequestCallback retour) {
19
		Request requeteSortie = null;
20
		try {
21
			requeteSortie = sendRequest(donneesRequete, retour);
22
		} catch (RequestException e) {
846 gduche 23
			GWT.log(Mediateur.i18nM.erreurJrest(), e);
463 jp_milcent 24
		}
25
		return requeteSortie;
26
	}
748 jpm 27
 
28
	public Request envoyerRequeteSuppression(RequestCallback retour) {
29
		Request requeteSortie = envoyerRequete("action=DELETE", retour);
30
		return requeteSortie;
31
	}
463 jp_milcent 32
 
33
}