Category : okhttp

I’m trying to enable public key pinning since I don’t want to release updates for every certificate renewal provided I’ll use the same CSR every time. I generated the hash with this script. #!/bin/bash certs=`openssl s_client -servername $1 -host $1 -port 443 -showcerts </dev/null 2>/dev/null | sed -n ‘/Certificate chain/,/Server certificate/p’` rest=$certs while [[ "$rest" ..

Read more

I want to do a simple PUT request in android studio using okhttp3. I know how to do GET requests. Below is the code which I have used to do GET request. public simplifYText(String question){ OkHttpClient client = new OkHttpClient(); String url = "http://vivekmishra01.pythonanywhere.com/"; Request request = new Request.Builder() .url(url) .build(); client.newCall(request).enqueue(new Callback() { @Override ..

Read more

I’m making an Adnroid app that sends API request on button click using OkHTTP However I’ve got this error in this line https://prnt.sc/10bbg1f https://prnt.sc/10bbgba Can you please let me know what’s wrong with it? package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import com.squareup.okhttp.Call; import com.squareup.okhttp.Callback; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.Response; import java.io.IOException; public ..

Read more