Package javax.microedition.io

Examples of javax.microedition.io.HttpConnection


  TweetPhotoResponse deleteLocation(long photoId) {
   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/photos/" + photoId + "/location";

    try {
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), null, getCoverageBasedConnectionType(), "DELETE", this, false);
         
      m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomTweetPhotoResponseParser responseParser = new DomTweetPhotoResponseParser();
        responseParser.m_Xml = xml;
        TweetPhotoResponse response = (TweetPhotoResponse)responseParser.parse();
        content.close();
View Full Code Here


    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/photos/" + photoId + "/location";

    try {
     
      String data = "" + latitude + "," + longitude;
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), data.getBytes(), getCoverageBasedConnectionType(), "PUT", this, false);

      m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomTweetPhotoResponseParser responseParser = new DomTweetPhotoResponseParser();
        responseParser.m_Xml = xml;
        TweetPhotoResponse response = (TweetPhotoResponse)responseParser.parse();
        content.close();
View Full Code Here

   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/settings/maptype";

    try {
      String data = "" + mapType;
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), data.getBytes(), getCoverageBasedConnectionType(), "PUT", this, false);
           
      m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomSettingsParser responseParser = new DomSettingsParser();
        responseParser.m_Xml = xml;
        Settings response = (Settings)responseParser.parse();
        content.close();
View Full Code Here

   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/settings/pin";

    try {
      String data = "" + pin;
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), data.getBytes(), getCoverageBasedConnectionType(), "PUT", this, false);
     
      m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomSettingsParser responseParser = new DomSettingsParser();
        responseParser.m_Xml = xml;
        Settings response = (Settings)responseParser.parse();
        content.close();
View Full Code Here

   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/settings/shortenurl";

    try {
      String data = "" + shortenUrl;
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), data.getBytes(), getCoverageBasedConnectionType(), "PUT", this, false);
          m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomSettingsParser responseParser = new DomSettingsParser();
        responseParser.m_Xml = xml;
        Settings response = (Settings)responseParser.parse();
        content.close();
View Full Code Here

   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/settings/donottweetfavoritephoto";

    try {
      String data = "" + flag;
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), data.getBytes(), getCoverageBasedConnectionType(), "PUT", this, false);
          m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomSettingsParser responseParser = new DomSettingsParser();
        responseParser.m_Xml = xml;
        Settings response = (Settings)responseParser.parse();
        content.close();
View Full Code Here

   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/settings/hideviewingpatterns";

    try {
      String data = "" + flag;
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), data.getBytes(), getCoverageBasedConnectionType(), "PUT", this, false);
          m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomSettingsParser responseParser = new DomSettingsParser();
        responseParser.m_Xml = xml;
        Settings response = (Settings)responseParser.parse();
        content.close();
View Full Code Here

   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/settings/hidevotes";

    try {
      String data = "" + flag;
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), data.getBytes(), getCoverageBasedConnectionType(), "PUT", this, false);
          m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomSettingsParser responseParser = new DomSettingsParser();
        responseParser.m_Xml = xml;
        Settings response = (Settings)responseParser.parse();
        content.close();
View Full Code Here

  TweetPhotoResponse deletePhoto(long photoId) {
   
    String urlToRequest       = "http://tweetphotoapi.com/api/tpapi.svc/photos/" + photoId;

    try {
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), null, getCoverageBasedConnectionType(), "DELETE", this, false);
          m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 200) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomTweetPhotoResponseParser responseParser = new DomTweetPhotoResponseParser();
        responseParser.m_Xml = xml;
        TweetPhotoResponse response = (TweetPhotoResponse)responseParser.parse();
        content.close();
View Full Code Here

  TweetPhotoResponse favorite(long userId, long photoId) {
   
    String urlToRequest = "http://tweetphotoapi.com/api/tpapi.svc/users/" + userId + "/favorites/" + photoId;

    try {
      HttpConnection httpConn = HttpUtils.makeHttpConnection(urlToRequest, new HttpHeaders(), null, getCoverageBasedConnectionType(), "POST", this, false);
          m_httpStatus = httpConn.getResponseCode();
    
      if (m_httpStatus != 201) {
               System.out.println("Error: " + m_httpStatus);
      } else {
        InputStream content = httpConn.openInputStream();
        String xml = convertStreamToString(content);
        DomTweetPhotoResponseParser responseParser = new DomTweetPhotoResponseParser();
        responseParser.m_Xml = xml;       
        TweetPhotoResponse response = (TweetPhotoResponse)responseParser.parse();
        content.close();        
View Full Code Here

TOP

Related Classes of javax.microedition.io.HttpConnection

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.