aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/test/java/android/net/http/AndroidHttpClient.java
blob: 701510b7174ccda10af1ad57a15a279f083637a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pre { line-height: 125%; margin: 0; }
td.linenos pre {
/*
 * ConnectBot: simple, powerful, open-source SSH client for Android
 * Copyright 2015 Kenny Root, Jeffrey Sharkey
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.http;

/**
 * This is a work-around until Robolectric 3.1 comes out with the fix for this.
 * https://github.com/robolectric/robolectric/issues/1862
 */
public class AndroidHttpClient {
}
span> request ): pass def get_op_method(self, op): """Get the method for an operation. For operation 'foo' looks for 'op_foo'. op operation name returns method or None """ op_method_name = 'op_' + op return getattr(self, op_method_name, None) def perform(self, req): """General operation handler for posted operations. For operation 'foo' looks for a method op_foo and calls it with op_foo(req). Replies with code 500 if op_foo is not found. The method must return a list when req.use_sxp is true and an HTML string otherwise (or list). Methods may also return a Deferred (for incomplete processing). req request """ op = req.args.get('op') if not op is None and len(op) == 1: op = op[0] op_method = self.get_op_method(op) if op_method: op_method( req )