Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "comments": "Testing",
- "quantity": 0,
- "retailerId": 0,
- "retailerquote": 0,
- "subProductId": 999,
- "unit": "kg",
- "wholesalerid": 999
- }
- HashMap<String,String> header = new HashMap<String, String>();
- header.put("Content-type","application/json");
- HashMap<String,String> data = new HashMap<String, String>();
- data.put("comments",comments);
- data.put("quantity",quantity);
- data.put("retailerId",retailerID);
- data.put("retailerquote",retailerQuote);
- data.put("wholesalerId",wholesalerID);
- data.put("unit",unit);
- data.put("subProductId",subProductID);
- Call<RequestQuoteCheck> call = RetrofitBaseAdapter.getCommonPathInterfaceRequestQuote().requestQuoteCheck(data);
- call.enqueue(new retrofit2.Callback<RequestQuoteCheck>() {
- @Override
- public void onResponse(Call<RequestQuoteCheck> call, Response<RequestQuoteCheck> response) {
- Toast.makeText(getApplicationContext(),response.message(),Toast.LENGTH_SHORT).show();
- }
- @Override
- public void onFailure(Call<RequestQuoteCheck> call, Throwable t) {
- }
- });
- public static WebserviceMethods getCommonPathInterfaceRequestQuote() {
- final OkHttpClient okHttpClient = new OkHttpClient.Builder()
- .readTimeout(30, TimeUnit.SECONDS)
- .connectTimeout(30, TimeUnit.SECONDS)
- .build();
- Retrofit restAdapterRequestQuote = new Retrofit.Builder()
- .baseUrl(Constants.baseURLforRequestQuote)
- .addConverterFactory(GsonConverterFactory.create())
- .client(okHttpClient)
- .build();
- WebserviceMethods retrofitinterfaces = restAdapterRequestQuote.create(WebserviceMethods.class);
- return retrofitinterfaces;
- }
- }
- @POST("requestQuoteCheck")
- Call<RequestQuoteCheck> requestQuoteCheck(
- @HeaderMap Map<String,String> data );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement