ODataRequest.Builder builder = new ODataRequest.Builder();
ODataRequest.Builder builder = new ODataRequest.Builder();
public static ODataRequest createODataRequest(ODataRequest.Method method, Map<String, String> headers) throws UnsupportedEncodingException { if (headers == null) { headers = new HashMap<>(); } return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setHeaders(headers) .setMethod(method) .build(); }
/** * Create an OData request with the given HTTP method, and list of media types in the 'Accept-header'. * * @param method The given HTTP method. * @param headers The given headers. * @param mediaTypes The given list of media types. * @return The created OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createODataRequest(ODataRequest.Method method, Map<String, String> headers, MediaType... mediaTypes) throws UnsupportedEncodingException { if (headers == null) { headers = new HashMap<>(); } return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setAccept(mediaTypes) .setMethod(method) .setHeaders(headers).build(); }
/** * Create an OData request with the given HTTP method, and list of media types in the 'Accept-header'. * * @param method The given HTTP method. * @param headers The given headers. * @param mediaTypes The given list of media types. * @return The created OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createODataRequest(ODataRequest.Method method, Map<String, String> headers, MediaType... mediaTypes) throws UnsupportedEncodingException { if (headers == null) { headers = new HashMap<>(); } return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setAccept(mediaTypes) .setMethod(method) .setHeaders(headers).build(); }
/** * Create an OData request with the given HHTP method and defined content type. * * @param method The given HTTP method. * @param contentType The given content type. * @return The created OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createODataRequestWithContentType(ODataRequest.Method method, MediaType contentType) throws UnsupportedEncodingException { return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setContentType(contentType) .setMethod(method).build(); }
/** * Create an OData request with the given URI and HTTP method. * * @param uri The given URI. * @param method The given HTTP method. * @return The built OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createODataRequest(String uri, ODataRequest.Method method) throws UnsupportedEncodingException { return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(uri) .setMethod(method).build(); }
/** * Create an OData request with the given HHTP method and defined content type. * * @param method The given HTTP method. * @param contentType The given content type. * @return The created OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createODataRequestWithContentType(ODataRequest.Method method, MediaType contentType) throws UnsupportedEncodingException { return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setContentType(contentType) .setMethod(method).build(); }
/** * Create an OData request with the given URI and HTTP method. * * @param uri The given URI. * @param method The given HTTP method. * @return The built OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createODataRequest(String uri, ODataRequest.Method method) throws UnsupportedEncodingException { return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(uri) .setMethod(method).build(); }
/** * Create an OData request with the given HHTP method. * * @param method The given HTTP method. * @return The created OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createSimpleODataRequest(ODataRequest.Method method) throws UnsupportedEncodingException { return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setMethod(method).build(); }
private static ODataRequest buildODataRequestFromString(String content, ODataUri serviceUri) throws UnsupportedEncodingException { ODataRequest.Builder requestBuilder = new ODataRequest.Builder(); requestBuilder.setBodyText(content, UTF_8.name()); requestBuilder.setUri(serviceUri.serviceRoot()); requestBuilder.setMethod(ODataRequest.Method.GET); return requestBuilder.build(); }
private ODataRequest buildODataRequestFromString(String content, ODataClientQuery query) throws UnsupportedEncodingException { ODataRequest.Builder requestBuilder = new ODataRequest.Builder(); requestBuilder.setBodyText(content, UTF_8.name()); requestBuilder.setUri(getTestServiceRoot(url, query.getEdmEntityName())); requestBuilder.setMethod(ODataRequest.Method.GET); return requestBuilder.build(); }
public static ODataRequest createODataRequest(ODataRequest.Method method, Map<String, String> headers) throws UnsupportedEncodingException { if (headers == null) { headers = new HashMap<>(); } return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setHeaders(headers) .setMethod(method) .build(); }
private ODataRequestContext buildODataPostContext(ODataUri serviceUri) throws UnsupportedEncodingException, ODataEdmException { ODataRequest request = new ODataRequest.Builder() .setUri(serviceUri.serviceRoot()) .setBodyText("", StandardCharsets.UTF_8.name()) .setAccept(ATOM_XML) .setMethod(POST) .build(); return new ODataRequestContext(request, serviceUri, entityDataModel); }
private static ODataRequestContext buildODataContext( String body, MediaType mediaType, ODataUri serviceUri) throws UnsupportedEncodingException, ODataEdmException { ODataRequest request = new ODataRequest.Builder().setBodyText(body, "UTF-8") .setUri(serviceUri.serviceRoot()) .setAccept(mediaType) .setMethod(GET).build(); return new ODataRequestContext(request, serviceUri, buildEntityDataModel()); }
/** * Create an OData request with the given HHTP method. * * @param method The given HTTP method. * @return The created OData request. * @throws UnsupportedEncodingException */ public static ODataRequest createSimpleODataRequest(ODataRequest.Method method) throws UnsupportedEncodingException { return new ODataRequest.Builder().setBodyText("test", "UTF-8") .setUri(SERVICE_ROOT) .setMethod(method).build(); }