mirror of
https://github.com/owncloud/android-library.git
synced 2026-08-21 21:33:08 +00:00
Add user agent in all the request
This commit is contained in:
@@ -104,7 +104,10 @@ public class CreateRemoteShareOperation extends RemoteOperation {
|
||||
post = new PostMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
//Log_OC.d(TAG, "URL ------> " + client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
|
||||
post.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); // necessary for special characters
|
||||
post.setRequestHeader( "Content-Type",
|
||||
"application/x-www-form-urlencoded; charset=utf-8"); // necessary for special characters
|
||||
post.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
|
||||
|
||||
post.addParameter(PARAM_PATH, mRemoteFilePath);
|
||||
post.addParameter(PARAM_SHARE_TYPE, Integer.toString(mShareType.getValue()));
|
||||
post.addParameter(PARAM_SHARE_WITH, mShareWith);
|
||||
|
||||
@@ -86,6 +86,7 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation {
|
||||
try {
|
||||
// Get Method
|
||||
get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
get.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
|
||||
|
||||
// Add Parameters to Get Method
|
||||
get.setQueryString(new NameValuePair[] {
|
||||
|
||||
@@ -67,6 +67,7 @@ public class GetRemoteSharesOperation extends RemoteOperation {
|
||||
try{
|
||||
get = new GetMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH);
|
||||
get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
|
||||
get.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
|
||||
status = client.executeMethod(get);
|
||||
if(isSuccess(status)) {
|
||||
String response = get.getResponseBodyAsString();
|
||||
|
||||
@@ -72,6 +72,7 @@ public class RemoveRemoteShareOperation extends RemoteOperation {
|
||||
delete = new DeleteMethod(client.getBaseUri() + ShareUtils.SHARING_API_PATH + id);
|
||||
|
||||
delete.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
|
||||
delete.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
|
||||
|
||||
status = client.executeMethod(delete);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user