How to add Apache HTTP API (legacy) as compile-time dependency to build.grade for Android M?

For API 23: Top level build.gradle – /build.gradle buildscript { … dependencies { classpath ‘com.android.tools.build:gradle:1.3.1’ } } … Module specific build.gradle – /app/build.gradle android { compileSdkVersion 23 buildToolsVersion “23.0.0” useLibrary ‘org.apache.http.legacy’ … } Official docs (for preview though): http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client Latest android gradle plugin changelog: http://tools.android.com/tech-docs/new-build-system

System.Net.Http vs Microsoft.Net.Http

Depends on the version. The old System.Net.Http packages (the 2.0 ones) are legacy packages which are deprecated in favor of Microsoft.Http.Net according to the description: Legacy package, System.Net.Http is now included in the ‘Microsoft.Net.Http’ package. They exist to provide the HttpClient in previous .NET versions and Portable Class libraries. You should use Microsoft.Net.Http in that … Read more

How can I login to a website with Python?

Maybe you want to use twill. It’s quite easy to use and should be able to do what you want. It will look like the following: from twill.commands import * go(‘http://example.org’) fv(“1”, “email-email”, “blabla.com”) fv(“1”, “password-clear”, “testpass”) submit(‘0’) You can use showforms() to list all forms once you used go… to browse to the site … Read more

How to send a Post body in the HttpClient request in Windows Phone 8?

UPDATE 2: From @Craig Brown: As of .NET 5 you can do: requestMessage.Content = JsonContent.Create(new { Name = “John Doe”, Age = 33 }); See JsonContent class documentation UPDATE 1: Oh, it can be even nicer (from this answer): requestMessage.Content = new StringContent(“{\”name\”:\”John Doe\”,\”age\”:33}”, Encoding.UTF8, “application/json”); This depends on what content do you have. You … Read more

What exactly is an HTTP Entity?

An HTTP entity is the majority of an HTTP request or response, consisting of some of the headers and the body, if present. It seems to be the entire request or response without the request or status line (although only certain header fields are considered part of the entity). To illustrate; here’s a request: POST … Read more

PHP GuzzleHttp. How to make a post request with params?

Since Marco’s answer is deprecated, you must use the following syntax (according jasonlfunk’s comment) : $client = new \GuzzleHttp\Client(); $response = $client->request(‘POST’, ‘http://www.example.com/user/create’, [ ‘form_params’ => [ ’email’ => ‘test@gmail.com’, ‘name’ => ‘Test user’, ‘password’ => ‘testpassword’, ] ]); Request with POST files $response = $client->request(‘POST’, ‘http://www.example.com/files/post’, [ ‘multipart’ => [ [ ‘name’ => ‘file_name’, … Read more

accepting HTTPS connections with self-signed certificates

The first thing you need to do is to set the level of verification. Such levels is not so much: ALLOW_ALL_HOSTNAME_VERIFIER BROWSER_COMPATIBLE_HOSTNAME_VERIFIER STRICT_HOSTNAME_VERIFIER Although the method setHostnameVerifier() is obsolete for new library apache, but for version in Android SDK is normal. And so we take ALLOW_ALL_HOSTNAME_VERIFIER and set it in the method factory SSLSocketFactory.setHostnameVerifier(). Next, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)