edu.ksu.canvas.net.RestClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of canvas-api Show documentation
Show all versions of canvas-api Show documentation
A native Java library to talk to the Canvas REST API
package edu.ksu.canvas.net;
import edu.ksu.canvas.exception.InvalidOauthTokenException;
import edu.ksu.canvas.oauth.OauthToken;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import javax.validation.constraints.NotNull;
public interface RestClient {
Response sendApiGet(@NotNull OauthToken token, @NotNull String url, int connectTimeout, int readTimeout) throws IOException;
Response sendJsonPost(@NotNull OauthToken token, @NotNull String url, String json, int connectTimeout, int readTimeout) throws IOException;
Response sendJsonPut(@NotNull OauthToken token, @NotNull String url, String json, int connectTimeout, int readTimeout) throws IOException;
Response sendApiPost(@NotNull OauthToken token, @NotNull String url, Map> postParameters, int connectTimeout, int readTimeout) throws InvalidOauthTokenException, IOException;
Response sendApiPostFile(@NotNull OauthToken token, @NotNull String url, Map> postParameters, String fileParameter, String filePath, InputStream is, int connectTimeout, int readTimeout) throws InvalidOauthTokenException, IOException;
Response sendApiDelete(@NotNull OauthToken token, @NotNull String url, Map> deleteParameters, int connectTimeout, int readTimeout) throws InvalidOauthTokenException, IOException;
Response sendApiPut(@NotNull OauthToken token, @NotNull String url, Map> putParameters, int connectTimeout, int readTimeout) throws InvalidOauthTokenException, IOException;
String sendUpload(String uploadUrl, Map> params, InputStream in, String filename, int connectTimeout, int readTimeout) throws IOException;
}