Kotlin - Fuel.post with headers return NetworkOnMainThreadException
I'm trying to call my server test using
Fuel.post with the header {"Message", "test"}.
if the request work well the server return my "message".
here is my fragment :
class FragmentAuthSignIn : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val v: View = inflater.inflate(R.layout.fragment_auth_sign_in, container, false)
(v.BtnLogin as Button).setOnClickListener {
val res =...