Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sdk): remove retrofit and okhttp #5

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

anonvt
Copy link
Contributor

@anonvt anonvt commented Jun 24, 2024

  • Added native alternative for Http POST
  • Tested with localhost
  • Check response for 200
  • Remove Retrofit and Okhttp

Test Bearer token Authorization
Add mocked test
Will be in future PRs

Closes: https://topsort.atlassian.net/browse/API-796

@anonvt anonvt requested a review from jbergstroem June 24, 2024 22:18
@anonvt anonvt marked this pull request as ready for review June 26, 2024 14:22
import com.topsort.analytics.model.ImpressionEvent
import com.topsort.analytics.model.PurchaseEvent

private const val apiUrl = "https://api.topsort.com/v1/events"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the hostname be a project wide constant and potentially overridable? Lets say we wanna point it at a staging or test environment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll address in future PRs when we get a better testing setup

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not about tests though

@anonvt anonvt merged commit e18ff74 into main Jul 3, 2024
internal fun HttpURLConnection.createPostConnection(): Connection {
val encoding = getRequestProperty("Content-Encoding") ?: ""
val outputStream: OutputStream =
if (encoding.contains("gzip")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we additionally wanna support deflate, br here? can the http library help us in any way?

@anonvt anonvt deleted the gui/chore/remove-okhttp-retrofit branch July 3, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants