FormEncodingBuilder.java
1.48 KB
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
37
38
39
40
41
42
package com.squareup.okhttp;
import okio.Buffer;
public final class FormEncodingBuilder
{
private static final MediaType CONTENT_TYPE = MediaType.parse("application/x-www-form-urlencoded");
private final Buffer content = new Buffer();
public final FormEncodingBuilder add(String paramString1, String paramString2)
{
if (this.content.size() > 0L) {
this.content.writeByte(38);
}
HttpUrl.canonicalize(this.content, paramString1, 0, paramString1.length(), " \"':;<=>@[]^`{}|/\\?#&!$(),~", false, true, true);
this.content.writeByte(61);
HttpUrl.canonicalize(this.content, paramString2, 0, paramString2.length(), " \"':;<=>@[]^`{}|/\\?#&!$(),~", false, true, true);
return this;
}
public final FormEncodingBuilder addEncoded(String paramString1, String paramString2)
{
if (this.content.size() > 0L) {
this.content.writeByte(38);
}
HttpUrl.canonicalize(this.content, paramString1, 0, paramString1.length(), " \"':;<=>@[]^`{}|/\\?#&!$(),~", true, true, true);
this.content.writeByte(61);
HttpUrl.canonicalize(this.content, paramString2, 0, paramString2.length(), " \"':;<=>@[]^`{}|/\\?#&!$(),~", true, true, true);
return this;
}
public final RequestBody build()
{
return RequestBody.create(CONTENT_TYPE, this.content.snapshot());
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/squareup/okhttp/FormEncodingBuilder.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/