Spring for Android also includes support for third-party HTTP client libraries. To utilize a specific ClientHttpRequestFactory you must either pass a new instance into the RestTemplate constructor, or call setRequestFactory(ClientHttpRequestFactory requestFactory) on an existing RestTemplate instance. Based on this recommendation RestTemplate checks the version of Android on which your app is running and uses the appropriate ClientHttpRequestFactory. Google recommends to use the J2SE facilities on Android 2.3 (Gingerbread) and newer, while previous versions should use the HttpComponents HttpClient. The default ClientHttpRequestFactory used when you create a new RestTemplate instance differs based on the version of Android on which your application is running. Support for native HttpClient 4.0 is deprecated in favor of the Android port of HttpClient 4.3. The standard JS2SE facilities are made available through SimpleClientHttpRequestFactory, while the HttpClient can be utilized via HttpComponentsAndroidClientHttpRequestFactory. There are two native HTTP clients available on Android, the standard J2SE facilities, and the HttpComponents HttpClient. RestTemplate provides an abstraction for making RESTful HTTP requests, and internally, RestTemplate utilizes a native Android HTTP client library for those requests. Establishing an OAuth 1.0a connection 3.4.5. Available Message Converters ByteArrayHttpMessageConverter FormHttpMessageConverter AllEncompassingFormHttpMessageConverter ResourceHttpMessageConverter SourceHttpMessageConverter StringHttpMessageConverter SimpleXmlHttpMessageConverter MappingJackson2HttpMessageConverter GsonHttpMessageConverter 2.7.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |