title: problem get products with retrofit (Woocommerce site)
body: <p>I want to get all products from site <code>woocommer</code> but getting an error of 401 whenever I login with app and get token. My code snippet is mentioned below</p>
  
  <p><code>class retrofit</code></p>
  
  <pre><code>class ApiClient {
  companion object {
      val BASE_URL = "https://refahshahrvand.com/wp-json/"
      private var retrofit:Retrofit? = null
      private var client:OkHttpClient? = null
  
      fun getClient() : Retrofit {
          client= OkHttpClient.Builder()
                  .readTimeout(100,TimeUnit.SECONDS)
                  .connectTimeout(100,TimeUnit.SECONDS)
                  .build()
          if (retrofit == null) {
              retrofit = Retrofit.Builder()
                  .baseUrl(BASE_URL)
                  .addConverterFactory(GsonConverterFactory.create())
                  .build()
          }
  
          return retrofit!!
      }
  
    }
  }   
  </code></pre>
  
  <p>class apiInterface</p>
  
  <pre><code>   interface ApiInterface {
  
                  @POST("wc/v3/products")
                  @FormUrlEncoded
                  fun getNamePro ( @Header("token") token: String,@Field("consumer_key") consumer_key: 
                    String,@Field("consumer_secret") consumer_secret: String):  Call&lt;List&lt;AllProducts&gt;&gt;
               }
  </code></pre>
  
  <p>this call get method</p>
  
  <pre><code>  private fun AllProductList(){
      var token2: String
      res = Respon()
      autologin = Autologin(context)
      token2 = autologin?.getToken().toString()
  
      val apiInterface = ApiClient.getClient().create(ApiInterface::class.java)
      val call : Call&lt;List&lt;AllProducts&gt;&gt; = apiInterface.getNamePro(token2, res?.consumer_key.toString(), res?.consumer_Secret.toString() )
  
      call.enqueue(
              object : Callback&lt;List&lt;AllProducts&gt;&gt; {
                  override fun onFailure(call: Call&lt;List&lt;AllProducts&gt;&gt;, t: Throwable) {
                      Log.e("*****-onFailure-*****" + t.toString(), call.toString())
                  }
  
                  override fun onResponse(call: Call&lt;List&lt;AllProducts&gt;&gt;, response: Response&lt;List&lt;AllProducts&gt;&gt;) {
                      val pr = response.body()
  
  
                      if (response != null) {
                          //adding items in list
                          for (i in 0..9) {
                              list_Prod.add(pr?.get(i)?.getName().toString())
                          }
                          mRecyclerView = view?.findViewById(R.id.Prod_recycler_view)
                          var mLayoutManager = LinearLayoutManager(view?.context, LinearLayoutManager.HORIZONTAL, false) as LinearLayoutManager
  
                          mRecyclerView!!.layoutManager = mLayoutManager
                          mAdapter = ProductsAdapter(list_Prod)
                          mRecyclerView!!.adapter = mAdapter
  
                          if (response.isSuccessful) {
                              Login.STATE_LOGIN = true
                              Log.e("*****-isSuccessful-****" + pr?.get(1)?.getName().toString(), response.toString())
  
                              for(i in 0..list_Prod!!.size -1){
  
                                  Toast.makeText(context , pr?.get(i)?.getName().toString(),
                                          Toast.LENGTH_LONG).show()
                                  // Log.e("** User_display_name : " + pr?.get(i)?.getName().toString(), response.toString())
                              }
  
                          } else {
                              Log.e("********#error#*******" + pr.toString(), call.toString())
                          }
  
                      }
                  }
  
              })
  }
  </code></pre>
  
  <p>Error logcat. Please help me.</p>
  
  <pre><code>&gt;E/********#error#*******null: retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall@308939e
  
  &gt;E/----------response---------: Response{protocol=h2, code=401, message=,  url=https://refahshahrvand.com/wp-json/wc/v3/products}
  </code></pre>