| name | framework-and-http |
|---|---|
| description | Use when changing Retrofit/OkHttp setup, Gson serialization, or HTTP behavior for the Marketplace client. |
- Editing
com.contentstack.sdk.Clientor howMarketplaceobtainsRetrofit - Adding interceptors, converters, or base URL behavior
- Debugging API calls built with Retrofit + Gson
Client.getInstance(String host)lazily creates oneRetrofitper JVM: the firsthostwins; later calls pass the parameter but do not recreate the client. MultipleMarketplaceinstances with different hosts in one process can mis-route requests unless this is addressed inClient.
createRetrofitInstancebuildshttps://{host}/and attachesGsonConverterFactory.create()— new endpoints should use Retrofit interfaces consistent with existing*Serviceclasses undermarketplace.- OkHttp is a direct dependency (version in
pom.xml) — configure timeouts, interceptors, or auth headers in one place when extending the stack.
- Gson is the Retrofit converter;
org.json.simpleis used where historical code requires it — follow the dominant pattern in the package you touch.
- Services typically use
retrofit2.Call/Response— preserve existing error-handling conventions when adding calls (seeMarketplaceand service classes for patterns).
- ../contentstack-marketplace-sdk/SKILL.md — domain entry points
- Retrofit, OkHttp