Home
last modified time | relevance | path

Searched refs:RequestBody (Results 1 – 25 of 35) sorted by relevance

12

/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/
DMultipartBuilderTest.java41 RequestBody requestBody = new MultipartBuilder("123") in singlePart()
42 .addPart(RequestBody.create(null, "Hello, World!")) in singlePart()
70 RequestBody requestBody = new MultipartBuilder("123") in threeParts()
71 .addPart(RequestBody.create(null, "Quick")) in threeParts()
72 .addPart(RequestBody.create(null, "Brown")) in threeParts()
73 .addPart(RequestBody.create(null, "Fox")) in threeParts()
114 RequestBody requestBody = new MultipartBuilder("AaB03x") in fieldAndTwoFiles()
121 RequestBody.create( in fieldAndTwoFiles()
127 RequestBody.create( in fieldAndTwoFiles()
167 RequestBody requestBody = new MultipartBuilder("AaB03x") in stringEscapingIsWeird()
[all …]
DRequestTest.java36 RequestBody body = RequestBody.create(contentType, "abc".getBytes(Util.UTF_8)); in string()
45 RequestBody body = RequestBody.create(contentType, "\u0800"); in stringWithDefaultCharsetAdded()
53 RequestBody body = RequestBody.create(contentType, "\u0800"); in stringWithNonDefaultCharsetSpecified()
61 RequestBody body = RequestBody.create(contentType, "abc".getBytes(Util.UTF_8)); in byteArray()
70 RequestBody body = RequestBody.create(contentType, ".abcd".getBytes(Util.UTF_8), 1, 3); in byteArrayRange()
84 RequestBody body = RequestBody.create(contentType, file); in file()
94 RequestBody body = RequestBody.create(contentType, "{}"); in crudVerbs()
231 private String bodyToHex(RequestBody body) throws IOException { in bodyToHex()
DFormEncodingBuilderTest.java26 RequestBody formEncoding = new FormEncodingBuilder() in urlEncoding()
43 RequestBody formEncoding = new FormEncodingBuilder() in addEncoded()
56 RequestBody formEncoding = new FormEncodingBuilder() in encodedPair()
69 RequestBody formEncoding = new FormEncodingBuilder() in encodeMultiplePairs()
84 RequestBody formEncoding = new FormEncodingBuilder().build(); in buildEmptyForm()
173 RequestBody body = new FormEncodingBuilder() in formEncode()
DCallTest.java223 new Request.Builder().method("GET", RequestBody.create(MediaType.parse("text/plain"), "abc")); in getWithRequestBody()
269 .post(RequestBody.create(MediaType.parse("text/plain"), "def")) in post()
303 .method("POST", RequestBody.create(null, new byte[0])) in postZeroLength()
377 .method("POST", RequestBody.create(null, body)) in postBodyRetransmittedAfterAuthorizationFail()
467 .method("DELETE", RequestBody.create(MediaType.parse("text/plain"), "def")) in deleteWithRequestBody()
484 .put(RequestBody.create(MediaType.parse("text/plain"), "def")) in put()
518 .patch(RequestBody.create(MediaType.parse("text/plain"), "def")) in patch()
552 .method("POST", RequestBody.create(null, "abc")) in unspecifiedRequestBodyContentTypeDoesNotGetDefault()
796 RequestBody requestBody1 = new RequestBody() { in reusedSinksGetIndependentTimeoutInstances()
813 RequestBody requestBody2 = new RequestBody() { in reusedSinksGetIndependentTimeoutInstances()
[all …]
DInterceptorTest.java221 RequestBody body = RequestBody.create(mediaType, "abc"); in networkInterceptorsCanChangeRequestMethodFromGetToPost()
266 .method("PUT", RequestBody.create(MediaType.parse("text/plain"), "abc")) in rewriteRequestToServer()
609 private RequestBody uppercase(final RequestBody original) { in uppercase()
610 return new RequestBody() { in uppercase()
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/
DRequestBody.java27 public abstract class RequestBody { class
46 public static RequestBody create(MediaType contentType, String content) { in create()
60 public static RequestBody create(final MediaType contentType, final ByteString content) { in create()
61 return new RequestBody() { in create()
77 public static RequestBody create(final MediaType contentType, final byte[] content) {
82 public static RequestBody create(final MediaType contentType, final byte[] content,
86 return new RequestBody() {
102 public static RequestBody create(final MediaType contentType, final File file) {
105 return new RequestBody() {
DMultipartBuilder.java79 private final List<RequestBody> partBodies = new ArrayList<>();
112 public MultipartBuilder addPart(RequestBody body) { in addPart()
117 public MultipartBuilder addPart(Headers headers, RequestBody body) { in addPart()
169 return addFormDataPart(name, null, RequestBody.create(null, value)); in addFormDataPart()
173 public MultipartBuilder addFormDataPart(String name, String filename, RequestBody value) { in addFormDataPart()
189 public RequestBody build() { in build()
196 private static final class MultipartRequestBody extends RequestBody {
200 private final List<RequestBody> partBodies;
204 List<RequestBody> partBodies) { in MultipartRequestBody()
239 RequestBody body = partBodies.get(p); in writeOrCountBytes()
DRequest.java32 private final RequestBody body;
85 public RequestBody body() { in body()
124 private RequestBody body;
231 public Builder post(RequestBody body) { in post()
235 public Builder delete(RequestBody body) { in delete()
240 return delete(RequestBody.create(null, new byte[0])); in delete()
243 public Builder put(RequestBody body) { in put()
247 public Builder patch(RequestBody body) { in patch()
251 public Builder method(String method, RequestBody body) { in method()
DFormEncodingBuilder.java56 public RequestBody build() { in build()
57 return RequestBody.create(CONTENT_TYPE, content.snapshot()); in build()
/external/okhttp/okhttp-ws-tests/src/test/java/com/squareup/okhttp/internal/ws/
DRealWebSocketTest.java19 import com.squareup.okhttp.RequestBody;
106 client.sendMessage(RequestBody.create(TEXT, "Hello!")); in textMessage()
112 client.sendMessage(RequestBody.create(BINARY, "Hello!")); in binaryMessage()
119 client.sendMessage(RequestBody.create(null, "Hey!")); in missingContentTypeThrows()
129 client.sendMessage(RequestBody.create(MediaType.parse("text/plain"), "Hey!")); in unknownContentTypeThrows()
139 RequestBody message = new RequestBody() { in streamingMessage()
156 RequestBody message = new RequestBody() { in streamingMessageCanInterleavePing()
213 client.sendMessage(RequestBody.create(TEXT, "Hello!")); in clientCloseThenMethodsThrow()
231 client.sendMessage(RequestBody.create(TEXT, "Hello!")); in socketClosedDuringPingKillsWebSocket()
248 client.sendMessage(RequestBody.create(TEXT, "Hello!")); in socketClosedDuringMessageKillsWebSocket()
[all …]
/external/okhttp/samples/guide/src/main/java/com/squareup/okhttp/recipes/
DRequestBodyCompression.java23 import com.squareup.okhttp.RequestBody;
50 RequestBody jsonRequestBody = RequestBody.create( in run()
82 private RequestBody gzip(final RequestBody body) { in gzip()
83 return new RequestBody() { in gzip()
DWebSocketEcho.java5 import com.squareup.okhttp.RequestBody;
39 webSocket.sendMessage(RequestBody.create(TEXT, "Hello...")); in onOpen()
40 webSocket.sendMessage(RequestBody.create(TEXT, "...World!")); in onOpen()
41 webSocket.sendMessage(RequestBody.create(BINARY, ByteString.decodeHex("deadbeef"))); in onOpen()
DPostMultipart.java22 import com.squareup.okhttp.RequestBody;
40 RequestBody requestBody = new MultipartBuilder() in run()
44 RequestBody.create(MEDIA_TYPE_PNG, new File("website/static/logo-square.png"))) in run()
DPostStreaming.java21 import com.squareup.okhttp.RequestBody;
33 RequestBody requestBody = new RequestBody() { in run()
DPostForm.java21 import com.squareup.okhttp.RequestBody;
29 RequestBody formBody = new FormEncodingBuilder() in run()
DPostString.java21 import com.squareup.okhttp.RequestBody;
42 .post(RequestBody.create(MEDIA_TYPE_MARKDOWN, postBody)) in run()
DPostFile.java21 import com.squareup.okhttp.RequestBody;
37 .post(RequestBody.create(MEDIA_TYPE_MARKDOWN, file)) in run()
/external/okhttp/okcurl/src/test/java/com/squareup/okhttp/curl/
DMainTest.java19 import com.squareup.okhttp.RequestBody;
45 RequestBody body = request.body(); in dataPost()
54 RequestBody body = request.body(); in dataPut()
64 RequestBody body = request.body(); in contentTypeHeader()
93 private static String bodyAsString(RequestBody body) { in bodyAsString()
/external/okhttp/samples/guide/src/main/java/com/squareup/okhttp/guide/
DPostExample.java6 import com.squareup.okhttp.RequestBody;
17 RequestBody body = RequestBody.create(JSON, json); in post()
/external/okhttp/okhttp-ws/src/main/java/com/squareup/okhttp/ws/
DWebSocket.java19 import com.squareup.okhttp.RequestBody;
40 void sendMessage(RequestBody message) throws IOException; in sendMessage()
/external/okhttp/okhttp-ws-tests/src/main/java/com/squareup/okhttp/ws/
DAutobahnTester.java20 import com.squareup.okhttp.RequestBody;
86 final RequestBody response; in runTest()
88 response = RequestBody.create(TEXT, message.string()); in runTest()
91 response = RequestBody.create(BINARY, source.readByteString()); in runTest()
/external/okhttp/okhttp-apache/src/main/java/com/squareup/okhttp/apache/
DHttpEntityBody.java4 import com.squareup.okhttp.RequestBody;
10 final class HttpEntityBody extends RequestBody {
DOkApacheClient.java7 import com.squareup.okhttp.RequestBody;
59 RequestBody body = null; in transformRequest()
71 body = RequestBody.create(null, new byte[0]); in transformRequest()
/external/okhttp/okhttp-logging-interceptor/src/test/java/com/squareup/okhttp/logging/
DHttpLoggingInterceptorTest.java22 import com.squareup.okhttp.RequestBody;
128 client.newCall(request().post(RequestBody.create(PLAIN, "Hi?")).build()).execute(); in basicPost()
197 Request request = request().post(RequestBody.create(PLAIN, "Hi?")).build(); in headersPost()
234 Request request = request().post(RequestBody.create(null, "Hi?")).build(); in headersPostNoContentType()
269 RequestBody body = new RequestBody() { in headersPostNoLength()
422 Request request = request().post(RequestBody.create(PLAIN, "Hi?")).build(); in bodyPost()
/external/okhttp/okhttp-ws-tests/src/test/java/com/squareup/okhttp/ws/
DWebSocketCallTest.java20 import com.squareup.okhttp.RequestBody;
67 webSocket.sendMessage(RequestBody.create(TEXT, "Hello, WebSockets!")); in clientMessage()
77 webSocket.sendMessage(RequestBody.create(TEXT, "Hello, WebSockets!")); in serverMessage()
200 webSocket.sendMessage(RequestBody.create(TEXT, "abc")); in websocketScheme()

12