Android Open Source - coinbase-bitmonet-sdk H T T P Utils






From Project

Back to project page coinbase-bitmonet-sdk.

License

The source code is released under:

Copyright (c) 2014, BitMonet and Coinbase Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditio...

If you think the Android project coinbase-bitmonet-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.bitmonet.utilities;
//ww  w .  j  a  va  2 s  .  c o  m
import java.io.IOException;
import java.io.UnsupportedEncodingException;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;

public class HTTPUtils {

  public static HttpResponse makeHttpPostWithJSONRequest(String path, String json) {
    try {
      HttpPost httpPost = new HttpPost(path);
      httpPost.setEntity(new StringEntity(json));
      httpPost.setHeader("Accept", "application/json");
      httpPost.setHeader("Content-type", "application/json");
      return new DefaultHttpClient().execute(httpPost);
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (ClientProtocolException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }

  public static HttpResponse makeHttpPostRequest(String path) {
    HttpClient httpclient = new DefaultHttpClient();
    HttpPost httppost = new HttpPost(path);
    try {
      return httpclient.execute(httppost);
    } catch (ClientProtocolException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }

    return null;
  }

}




Java Source Code List

com.bitmonet.BitmonetOAuthStatusListener.java
com.bitmonet.BitmonetPaymentStatusListener.java
com.bitmonet.Bitmonet.java
com.bitmonet.Constants.java
com.bitmonet.PaymentDialog.java
com.bitmonet.TransferMoneyListener.java
com.bitmonet.coinbase.CoinbasePaymentProcessor.java
com.bitmonet.coinbase.CoinbaseWebView.java
com.bitmonet.utilities.HTTPUtils.java
com.bitmonet.utilities.JSONUtils.java
com.bitmonet.utilities.OAuthHelperUtils.java
com.bitmonet.utilities.URLUtils.java
com.bitmonet.utilities.UserProfileSettings.java
com.testapplication.MainActivity.java