[PR #126] [MERGED] adds basic auth support and refactored MainHttpClient class. #375

Closed
opened 2026-02-28 01:24:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ushahidi/SMSSync/pull/126
Author: @mandric
Created: 9/20/2013
Status: Merged
Merged: 9/24/2013
Merged by: @eyedol

Base: developHead: http-client-refactor


📝 Commits (10+)

  • 13543fd adds basic auth support and refactored MainHttpClient class.
  • cf369ea indentation/style tweaks.
  • 0654bcd added getParams, setEntity to MainHttpClient class.
  • d928a5e refactored ProcessMessage and MessageSyncHtptClient classes.
  • d347af2 continued MessageSyncHttpClient refactor.
  • a95dee2 removed getFromWebService method from MainHttpClient
  • 89605a8 added basic auth test, bit more MainHTTPClient refactor.
  • 71bfcbe removed stacktrace comment.
  • 4b2949a added example URL in howto on basic auth.
  • 69a7c29 changed example urls to https.

📊 Changes

6 files changed (+456 additions, -214 deletions)

View changed files

📝 genwebsite/howto.mkd (+6 -4)
📝 smssync/src/instrumentTest/java/org/addhen/smssync/tests/services/SyncSchemeTest.java (+70 -12)
📝 smssync/src/main/java/org/addhen/smssync/messages/ProcessMessage.java (+27 -10)
📝 smssync/src/main/java/org/addhen/smssync/net/MainHttpClient.java (+216 -57)
📝 smssync/src/main/java/org/addhen/smssync/net/MessageSyncHttpClient.java (+136 -130)
📝 smssync/src/main/java/org/addhen/smssync/util/Util.java (+1 -1)

📄 Description

fixes ushahidi#17

This handled adding user-agent and basic auth headers to all requests.
Allows easily adding query params or headers via addParam. and
addHeader.

Planning to reuse this class a bit more in some related callback
features. Also was planning to refactor MessageSyncHttpClient and use
the new methods to simplify a bit and show how to use the API.

I replaced the poorly named getText function with a getResponse and
convertStreamToString static method.

Also added $ to URL_PATTERN in case you have that in your basic auth
password.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ushahidi/SMSSync/pull/126 **Author:** [@mandric](https://github.com/mandric) **Created:** 9/20/2013 **Status:** ✅ Merged **Merged:** 9/24/2013 **Merged by:** [@eyedol](https://github.com/eyedol) **Base:** `develop` ← **Head:** `http-client-refactor` --- ### 📝 Commits (10+) - [`13543fd`](https://github.com/ushahidi/SMSSync/commit/13543fd59d36cf3e0dd25ff7b485f7a07aedc099) adds basic auth support and refactored MainHttpClient class. - [`cf369ea`](https://github.com/ushahidi/SMSSync/commit/cf369ea21826894ae850668bc4ce8a76694d6ab9) indentation/style tweaks. - [`0654bcd`](https://github.com/ushahidi/SMSSync/commit/0654bcd7f35285965848d9f88947bbbfffd49385) added getParams, setEntity to MainHttpClient class. - [`d928a5e`](https://github.com/ushahidi/SMSSync/commit/d928a5ec16f53f0b01f294125fb17185ebe57ba9) refactored ProcessMessage and MessageSyncHtptClient classes. - [`d347af2`](https://github.com/ushahidi/SMSSync/commit/d347af2f1123569882ac2455ce3d351ee77c5249) continued MessageSyncHttpClient refactor. - [`a95dee2`](https://github.com/ushahidi/SMSSync/commit/a95dee24702e3ea30abe8fc412330153dd1013ac) removed `getFromWebService` method from MainHttpClient - [`89605a8`](https://github.com/ushahidi/SMSSync/commit/89605a81c2563f521225ea06f426222316767e4e) added basic auth test, bit more MainHTTPClient refactor. - [`71bfcbe`](https://github.com/ushahidi/SMSSync/commit/71bfcbed9fccbd4fc107ef60f2d649a71a51c57f) removed stacktrace comment. - [`4b2949a`](https://github.com/ushahidi/SMSSync/commit/4b2949ab0848277417247b060c3a01156ddbd1b3) added example URL in howto on basic auth. - [`69a7c29`](https://github.com/ushahidi/SMSSync/commit/69a7c292201b170e1105272510093a520abfead8) changed example urls to https. ### 📊 Changes **6 files changed** (+456 additions, -214 deletions) <details> <summary>View changed files</summary> 📝 `genwebsite/howto.mkd` (+6 -4) 📝 `smssync/src/instrumentTest/java/org/addhen/smssync/tests/services/SyncSchemeTest.java` (+70 -12) 📝 `smssync/src/main/java/org/addhen/smssync/messages/ProcessMessage.java` (+27 -10) 📝 `smssync/src/main/java/org/addhen/smssync/net/MainHttpClient.java` (+216 -57) 📝 `smssync/src/main/java/org/addhen/smssync/net/MessageSyncHttpClient.java` (+136 -130) 📝 `smssync/src/main/java/org/addhen/smssync/util/Util.java` (+1 -1) </details> ### 📄 Description fixes ushahidi#17 This handled adding user-agent and basic auth headers to all requests. Allows easily adding query params or headers via `addParam`. and `addHeader`. Planning to reuse this class a bit more in some related callback features. Also was planning to refactor MessageSyncHttpClient and use the new methods to simplify a bit and show how to use the API. I replaced the poorly named `getText` function with a `getResponse` and `convertStreamToString` static method. Also added `$` to URL_PATTERN in case you have that in your basic auth password. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 01:24:22 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#375
No description provided.