1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| package cn.emay.sdk.util.http.request.impl;
|
| import java.io.UnsupportedEncodingException;
| import java.util.Map;
|
| import cn.emay.sdk.util.http.request.EmayHttpRequest;
|
| /**
| * 传输数据为String的请求实体
| *
| * @author Frank
| *
| */
| public class EmayHttpRequestString extends EmayHttpRequest<String>{
|
| public EmayHttpRequestString(String url, String charSet, String method, Map<String, String> headers, String cookies, String params) {
| super(url, charSet, method, headers, cookies, params);
| }
|
| @Override
| public byte[] paramsToBytesForPost() {
| try {
| return this.getParams().getBytes(this.getCharSet());
| } catch (UnsupportedEncodingException e) {
| e.printStackTrace();
| return null;
| }
| }
|
| @Override
| public String paramsToStringForGet() {
| return this.getParams();
| }
|
|
| }
|
|