Giter Site home page Giter Site logo

httpclientandroidlib's Introduction

Project contents:

./script/
  Script to convert a stock HttpClient into an Android library

You'll need apache-ant and the Android SDK tools path needs to be
included in your PATH variable.

Instructions:

Change directory to "script" and run the script.

cd script
./convert_stock_httpclient

httpclientandroidlib's People

Contributors

dirkboye avatar

Watchers

 avatar

httpclientandroidlib's Issues

BASIC Auth broken

basic auth not working in released jar

it adds extra newlines between headers

the root of the problem seems to be Base64.encode from android (it adds a 
newline when used with default flags, try Base64.NO_WRAP)


Original issue reported on code.google.com by [email protected] on 30 Sep 2011 at 12:14

Update HttpCore

Not a problem but apache have updated HttpCore to 4.1.4

http://www.apache.org/dist/httpcomponents/httpcore/RELEASE_NOTES-4.1.x.txt

Good job anyway.

Original issue reported on code.google.com by [email protected] on 29 Dec 2011 at 7:43

加载正确的证书访问https服务时,android4.0以下版本报错


加载正确的证书,去访问https服务。4.0以下版本的android会提��
�找不到证书位置的错误,
代码如下:
 KeyStore trustStore  = KeyStore.getInstance(KeyStore.getDefaultType());
                ins = context.getResources().openRawResource(R.raw.huipumobile); // 下载的证书放到项目中的assets目录中
                 trustStore.load(ins, "123456".toCharArray());
                 SSLContext sslcontext = SSLContexts.custom()
                    .loadTrustMaterial(trustStore)
                    .build();

            SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext,
                    SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
            httpClient = HttpClients.custom()
                    .setSSLSocketFactory(sslsf)
                    .build();

Original issue reported on code.google.com by [email protected] on 23 Jan 2014 at 12:04

PoolingClientConnectionManager

Hello, 

I am wondering, why the hole 
PoolingClientConnectionManager/ClientConnectionManager stuff isn't in 
httpclientandroidlib?

Original issue reported on code.google.com by [email protected] on 29 Jun 2012 at 2:38

MultipartEntityBuilder creates malformed HttpEntity

This issue is an issue of Apache HttpClient 4.3.1 and was fixed in release 4.3.2

See https://issues.apache.org/jira/browse/HTTPCLIENT-1426


Parts of multipart HttpEntity added with 
MultipartEntityBuilder.addBinaryBody(String name, File file) don't contain 
fields "filename" and "Content-Type", thus Commons FileUpload handles them as 
form fields, not files. 
The problem is probably caused by empty filename of the created FileBody. 

Is planned a new release with the repackage of this release?
Thanks

Original issue reported on code.google.com by [email protected] on 19 Feb 2014 at 6:53

httpClient.log.enableDebug(true); doesn't work

I've been using your httpclientandroidlib since version 1.1.2 and i need to 
debug everything. Unfortunaltely i'm not able to call 
httpClient.log.enableDebug() as mentioned in the project page.

Is it hard to get this working in another way?

thanks!


Original issue reported on code.google.com by [email protected] on 3 Mar 2014 at 9:48

ClassNotFound

What steps will reproduce the problem?
1. Use the library in a project and with a couple of methods.

What is the expected output? What do you see instead?
None of methods work; they all return ClassNotFound error.

What version of the product are you using? On what operating system?
1.0.2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 13 Feb 2012 at 4:35

Incompatible with Mac

The sed commands in the convert_stock_httpclient script are incompatible with 
the default version of sed on a mac.

To make a mac-compliant version, replace commands like this:

sed -i "s/ACTIVITY_ENTRY_NAME/${PROJECTNAME}/g" AndroidManifest.xml

with this:

sed -e "s/ACTIVITY_ENTRY_NAME/${PROJECTNAME}/g" -i '' AndroidManifest.xml


Note: the zero-length extension (two single quotes) passed to the -i option. 
It's better (and highly recommended) to provide an extension like this:

sed -e "s/ACTIVITY_ENTRY_NAME/${PROJECTNAME}/g" -i '.bak' AndroidManifest.xml

However, then every execution will leave backup files in the directory that 
need to be managed.

Original issue reported on code.google.com by [email protected] on 4 Jun 2013 at 2:22

script issues

What steps will reproduce the problem?
1.download
2. run script
3.

What is the expected output? What do you see instead?
2 lines in the script cause issues on my system


What version of the product are you using? On what operating system?
1.1.2

Please provide any additional information below.

i had to change the following 2 lines:
android create lib-project -n ${PROJECTNAME} -t 6 -p ${ANDROIDPROJECTPATH} -k 
${PACKAGENAME}
cp ${ROOTDIR}/script/androidextra/* androidextra

Notes: android targets available did not match my system

there was a node missing (./script) in the copy statement for the 2 java files 
in ./androidextra




Original issue reported on code.google.com by [email protected] on 15 Jun 2013 at 6:43

Gzip decompression very very slow

What steps will reproduce the problem?
1. Http get or post with gzip compression used by server 
Example:
response.setHeader("Content-Encoding", "gzip");
GZIPOutputStream gzipOutputStream = new 
GZIPOutputStream(response.getOutputStream())

In this case decompression of response body is drammatically slow. See issue

https://issues.apache.org/jira/browse/HTTPCLIENT-1461

Thanks

Original issue reported on code.google.com by [email protected] on 5 Dec 2014 at 4:48

Not valid Jar

What steps will reproduce the problem?
1. Try to open the jar file directly
2.
3.

What is the expected output? What do you see instead?
It should be Java exception ocurred, but it instead is an invalid jar file. 
That is causing problems in my program.

What version of the product are you using? On what operating system?
1.0.2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 13 Feb 2012 at 9:53

httpmime not bundled in the resulting jar

It seems that httpmime directory is not included at all in the script (1.0.3 
and all previous). Is it on purpose or it is just omited?

httpmime contains one very important class: MultiPartEntity. It is needed in 
order to send multipart form data (e.g. file uploads).

btw, there is 4.1.3 released and it seems like the right moment to release 
1.0.4 with httpmime bundled :-)

Original issue reported on code.google.com by [email protected] on 20 Mar 2012 at 10:12

DefaultHttpClient() is depricated in the new build

What should i use instead of DefaultHttpClient() in order to do a 
multipart/form request ? 

Below is my code for uploading a file:



    String upload_url = BASE_URL + UPLOAD_FILE;
         HttpClient httpclient = new DefaultHttpClient();
        HttpPost postRequest = new HttpPost(upload_url);
        MultipartEntityBuilder entity = MultipartEntityBuilder.create();

        try {
            // Set Data and Content-type header for the image
            FileBody fb = new FileBody(file, ContentType.MULTIPART_FORM_DATA);
            StringBody directoryIDString = new StringBody(directoryID + "",ContentType.TEXT_PLAIN);
            StringBody imageCreatedString = new StringBody(image_created_on
                    + "",ContentType.TEXT_PLAIN);

            Log.e("Upload File Response", image_created_on);

            entity.addPart("directory_id", directoryIDString);
            entity.addPart("created_on", imageCreatedString);
            entity.addPart("file", fb);
            postRequest.setEntity(entity.build());

            HttpResponse response = httpclient.execute(postRequest);
            // Read the response
            String jsonString = EntityUtils.toString(response.getEntity());
            Log.i("Upload File Response ", jsonString);
            return true;

        } catch (Exception e) {
            Log.e("Error in uploadFile", e.getMessage());
            return false;
        }

Original issue reported on code.google.com by [email protected] on 28 Mar 2014 at 11:34

Support for HttpClient Cache

Can you do the same "Android-ization" for HttpClient Cache?

Having a nice, easy to use working cache for HttpClient would benefit quite a 
few Android application, I bet!

https://hc.apache.org/httpcomponents-client-ga/httpclient-cache/index.html

Original issue reported on code.google.com by [email protected] on 5 Oct 2011 at 6:58

Port from bash to cross-platform Maven

Here's the start of a port from bash to pure Maven.
I didn't finish it, because I found this plugin and it solved my issue:    
  <groupId>org.sonatype.plugins</groupId>
  <artifactId>jarjar-maven-plugin</artifactId>
  <version>1.8</version>

Hopefully this Maven pom will be useful for someone who cant use the 
jarjar-maven-plugin. Included:
1. get the dependency sources
2. upack them
3. filter out some files


<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>jarjar</artifactId>
  <packaging>jar</packaging>
  <name>jarjar - Third Party Dependencies</name>
  <properties>
   <http.component.version>4.2.3</http.component.version>
   <commons.codec.version>1.8</commons.codec.version> 
   <gson.version>2.1</gson.version> 
  </properties>
    <dependencies>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>${http.component.version}</version>  
        <classifier>sources</classifier>
      </dependency>
      <dependency>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpcore</artifactId>
          <version>${http.component.version}</version>
        <classifier>sources</classifier>
      </dependency>
      <dependency>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpmime</artifactId>
          <version>${http.component.version}</version>
        <classifier>sources</classifier>
      </dependency>
      <dependency>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient-cache</artifactId>
          <version>${http.component.version}</version>
        <classifier>sources</classifier>
      </dependency>
      <dependency>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
          <version>${commons.codec.version}</version>
        <classifier>sources</classifier>
      </dependency>
      <dependency>
          <groupId>com.google.gson</groupId>
          <artifactId>gson</artifactId>
          <version>${gson.version}</version>
          <classifier>sources</classifier>
      </dependency>
    </dependencies>   
    <build>
    <plugins>           
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>unpack-httpclient</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>unpack-dependencies</goal>
                </goals>
                <configuration>                  <includeArtifacIds>httpclient,httpcore,httpmime,httpclient-cache</includeArtifacIds>
                  <includeGroupIds>org.apache.httpcomponents</includeGroupIds>
                  <includeClassifiers>sources</includeClassifiers>
                  <excludes>**/org/apache/http/impl/client/cache/ehcache/*,
                  **/org/apache/http/impl/client/cache/memcached/*,
                  **/NegotiateScheme.java,**/NegotiateSchemeFactory.java,
                  **/GGSSchemeBase.java,**/KerberosScheme.java,
                  **/KerberosSchemeFactory.java,**/SPNegoScheme.java,
                  **/SPNegoSchemeFactory.java</excludes>
                  <outputDirectory>${project.build.directory}/jarjar</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>unpack-commons-codec</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>unpack-dependencies</goal>
                </goals>
                <configuration>
                  <includeArtifacIds>commons-codec</includeArtifacIds>
                  <includeGroupIds>commons-codec</includeGroupIds>
                  <outputDirectory>${project.build.directory}/jarjar</outputDirectory>
                  <includeClassifiers>sources</includeClassifiers>
                </configuration>
              </execution>
            </executions>
          </plugin>      
    </plugins>
  </build>
</project>

Original issue reported on code.google.com by [email protected] on 12 Oct 2013 at 8:27

Please add jar to Maven Central

Thanks for making this!

What steps will reproduce the problem?
1. Attempt to use the jar with maven pom.xml
2. Must install jar locally.
3. Wish to find the jar as a dependency in Maven Central


Original issue reported on code.google.com by [email protected] on 17 Mar 2012 at 10:50

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.