use of com.reprezen.kaizen.oasparser.model3.RequestBody in project org.hl7.fhir.core by hapifhir.
the class Client method issuePostFeedRequest.
public Bundle issuePostFeedRequest(URI resourceUri, Map<String, String> parameters, String resourceName, Resource resource, String resourceFormat) throws IOException {
String boundary = "----WebKitFormBoundarykbMUo6H8QaUnYtRy";
byte[] payload = ByteUtils.encodeFormSubmission(parameters, resourceName, resource, boundary);
RequestBody body = RequestBody.create(MediaType.parse(resourceFormat + ";charset=" + DEFAULT_CHARSET), payload);
Request.Builder request = new Request.Builder().url(resourceUri.toURL()).post(body);
return executeBundleRequest(request, resourceFormat, new Headers.Builder().build(), null, retryCount, timeout);
}
use of com.reprezen.kaizen.oasparser.model3.RequestBody in project org.hl7.fhir.core by hapifhir.
the class Client method issuePutRequest.
public <T extends Resource> ResourceRequest<T> issuePutRequest(URI resourceUri, byte[] payload, String resourceFormat, Headers headers, String message, long timeout) throws IOException {
if (payload == null)
throw new EFhirClientException("PUT requests require a non-null payload");
RequestBody body = RequestBody.create(payload);
Request.Builder request = new Request.Builder().url(resourceUri.toURL()).put(body);
return executeFhirRequest(request, resourceFormat, headers, message, retryCount, timeout);
}
use of com.reprezen.kaizen.oasparser.model3.RequestBody in project google-maps-services-java by googlemaps.
the class OkHttpRequestHandler method handlePost.
@Override
public <T, R extends ApiResponse<T>> PendingResult<T> handlePost(String hostName, String url, String payload, String userAgent, String experienceIdHeaderValue, Class<R> clazz, FieldNamingPolicy fieldNamingPolicy, long errorTimeout, Integer maxRetries, ExceptionsAllowedToRetry exceptionsAllowedToRetry, RequestMetrics metrics) {
RequestBody body = RequestBody.create(JSON, payload);
Request.Builder builder = new Request.Builder().post(body).header("User-Agent", userAgent);
if (experienceIdHeaderValue != null) {
builder = builder.header(HttpHeaders.X_GOOG_MAPS_EXPERIENCE_ID, experienceIdHeaderValue);
}
Request req = builder.url(hostName + url).build();
return new OkHttpPendingResult<>(req, client, clazz, fieldNamingPolicy, errorTimeout, maxRetries, exceptionsAllowedToRetry, metrics);
}
use of com.reprezen.kaizen.oasparser.model3.RequestBody in project huabei_competition by fcy354268003.
the class NPCRel method queryProduct.
/**
* 查询商店道具列表
*/
public static void queryProduct(Callback callback) {
String json = gson.toJson(new A());
RequestBody requestBody = RequestBody.create(ChatRoomUtil.JSON, json);
Request request = new Request.Builder().url(LogIn.BASIC_PATH + PATH_GET_PRO_LIST).post(requestBody).build();
client.newCall(request).enqueue(callback);
}
use of com.reprezen.kaizen.oasparser.model3.RequestBody in project huabei_competition by fcy354268003.
the class NPCRel method buyProp.
/**
* @param id 商品或者商店角色id
*/
public static void buyProp(String id, Callback callback, int type) {
String json = gson.toJson(new Buy(id));
RequestBody requestBody = RequestBody.create(ChatRoomUtil.JSON, json);
Request request;
Request.Builder builder = new Request.Builder();
builder.url(LogIn.BASIC_PATH + PATH_BUY_PROP).post(requestBody);
if (type == 1) {
builder.url(LogIn.BASIC_PATH + PATH_BUY_ROLE);
}
request = builder.build();
client.newCall(request).enqueue(callback);
}
Aggregations