I can't link my text from the input field to my C# code

My project is when i type in a code a terrain is generated. The problem is that when i type in the code the input field doesn’t sent the text value to the code. So the whole idea is that when i type in the input field its sends its text to this code.

public class Test : MonoBehaviour
{
public string fname;
public string zdr;
public GameObject inputField;

public void GetCodeAndGenerateTerrain()
{
    zdr = inputField.GetComponent<InputField>().text;

    StartCoroutine(GetRequest("https://flora.noit.eu/zip/", zdr));

The idea is that i need the text from the input field to go where the second “zdr” is.
I have tried many things but with no success. The problem is that when i type the code it doesn’t not do what is supposed to do.

You need to call GetCodeAndGenerateTerrain() you can put it on a button, or call it on value changed. A button seems better tho for this purpose.