Package api.http

Examples of api.http.HttpRequest.send()


    httpQuery.add("Email", this.user);
    httpQuery.add("Passwd", this.password);
    httpQuery.add("service", this.service);
    httpQuery.add("source", this.source);
    httpRequest.setData(httpQuery.toString());
    String response = httpRequest.send();
    String responses[] = response.split("\n");
    String authHeader = "Auth=";
    for (String r : responses){
      if (r.indexOf(authHeader) == 0){
        this.authToken = r.substring(authHeader.length());
View Full Code Here


    HttpRequest httpRequest = new HttpRequest(url);
    if (googleapi != null){
      KeyValuePair pair = googleapi.toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    this.initial(document.getDocumentElement());
  }

  /**
 
View Full Code Here

    HttpRequest httpRequest = new HttpRequest(url);
    if (this.googleapi != null){
      KeyValuePair pair = this.googleapi.toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    return new PicasaAlbum(this, document.getDocumentElement());
  }

  /**
 
View Full Code Here

    HttpRequest httpRequest = new HttpRequest(this.feedUrl);
    if (this.googleapi != null){
      KeyValuePair pair = this.googleapi.toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    List<PicasaAlbum> picasaAlbums = new ArrayList<PicasaAlbum>();
    NodeList entries = document.getElementsByTagName("entry");
    for (int i = 0; i < entries.getLength(); i++){
      Element entry = (Element)entries.item(i);
View Full Code Here

    }
    String data = PicasaAlbum.createAlbumXML(title, description, access, lastModified, canComment, position, location, cover, null);
    httpRequest.setData(data);
    httpRequest.setMethod("POST");
    httpRequest.setContentType("application/atom+xml");
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    return new PicasaAlbum(this, document.getDocumentElement());
  }

  /**
 
View Full Code Here

    }
    String data = PicasaPhoto.createPhotoXML(this.title, this.description, this.lastModified, this.keywords, this.canComment, this.position);
    httpRequest.setData(data);
    httpRequest.setMethod(HttpRequest.METHOD_PUT);
    httpRequest.setContentType("application/atom+xml");
    String response = httpRequest.send();
  }

  /**
   * deleted the Picasa Photo.
   *
 
View Full Code Here

      KeyValuePair pair = this.picasaAlbum.getPicasaWeb().getGoogleapi().toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    httpRequest.setMethod(HttpRequest.METHOD_DELETE);
    httpRequest.setContentType("application/atom+xml");
    String response = httpRequest.send();
    this.title = null;
    this.photoId = null;
    this.description = null;
    this.lastModified = null;
    this.keywords = null;
View Full Code Here

    HttpRequest httpRequest = new HttpRequest(url);
    if (this.picasaAlbum.getPicasaWeb().getGoogleapi() != null){
      KeyValuePair pair = this.picasaAlbum.getPicasaWeb().getGoogleapi().toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    return new PicasaComment(this, document.getDocumentElement());
  }

  /**
 
View Full Code Here

    HttpRequest httpRequest = new HttpRequest(this.feedUrl);
    if (this.picasaAlbum.getPicasaWeb().getGoogleapi() != null){
      KeyValuePair pair = this.picasaAlbum.getPicasaWeb().getGoogleapi().toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    String response = httpRequest.send();
    Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(response)));
    List<PicasaComment> picasaComments = new ArrayList<PicasaComment>();
    NodeList entries = document.getElementsByTagName("entry");
    for (int i = 0; i < entries.getLength(); i++){
      Element entry = (Element)entries.item(i);
View Full Code Here

      KeyValuePair pair = this.picasaPhoto.getPicasaAlbum().getPicasaWeb().getGoogleapi().toAuthHeader();
      httpRequest.addHeader(pair.key, pair.value);
    }
    httpRequest.setMethod(HttpRequest.METHOD_DELETE);
    httpRequest.setContentType("application/atom+xml");
    String response = httpRequest.send();
    this.tag = null;
    this.editUrl = null;
    this.lastModified = null;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.