Package com.google.api.client.http

Examples of com.google.api.client.http.HttpMediaType


   * @since 1.5
   * @deprecated (scheduled to be removed in 1.12) Use {@link #setMediaType(HttpMediaType)} instead.
   */
  @Deprecated
  public JsonHttpContent setType(String type) {
    setMediaType(new HttpMediaType(type));
    return this;
  }
View Full Code Here


  /**
   * @param namespaceDictionary XML namespace dictionary
   * @since 1.5
   */
  protected AbstractXmlHttpContent(XmlNamespaceDictionary namespaceDictionary) {
    super(new HttpMediaType(Xml.MEDIA_TYPE));
    this.namespaceDictionary = Preconditions.checkNotNull(namespaceDictionary);
  }
View Full Code Here

   * @param isEntry {@code true} for an Atom entry or {@code false} for an Atom feed
   * @since 1.5
   */
  protected AtomContent(XmlNamespaceDictionary namespaceDictionary, Object entry, boolean isEntry) {
    super(namespaceDictionary);
    setMediaType(new HttpMediaType(Atom.MEDIA_TYPE));
    this.entry = Preconditions.checkNotNull(entry);
    this.isEntry = isEntry;
  }
View Full Code Here

    return internalExecute(requests);
  }

  private HttpRequest internalExecute(Object data) {
    JsonHttpContent content = new JsonHttpContent(jsonFactory, data);
    content.setMediaType(new HttpMediaType(mimeType));
    HttpRequest httpRequest;
    try {
      httpRequest =
          transport.createRequestFactory().buildPostRequest(new GenericUrl(rpcServerUrl), content);
      httpRequest.getHeaders().setAccept(accept);
View Full Code Here

   *
   * @param requestInfos List of request infos
   * @param boundary Boundary string to use for separating each HTTP request
   */
  MultipartMixedContent(List<BatchRequest.RequestInfo<?, ?>> requestInfos, String boundary) {
    super(new HttpMediaType("multipart/mixed").setParameter(
        "boundary", Preconditions.checkNotNull(boundary)));
    Preconditions.checkNotNull(requestInfos);
    Preconditions.checkArgument(!requestInfos.isEmpty());
    this.requestInfos = Collections.unmodifiableList(requestInfos);
  }
View Full Code Here

    if (notification.getContentType() == null) {
      return null;
    }

    // Parse the response otherwise
    Charset charset = notification.getContentType() == null ? null : new HttpMediaType(
        notification.getContentType()).getCharsetParameter();
    return parser.parseAndClose(notification.getContent(), charset, dataClass);
  }
View Full Code Here

TOP

Related Classes of com.google.api.client.http.HttpMediaType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.