Ethernet Page Request - Serial Print shows random characters

Hey everyone;

Trying to do html request and process the text data coming from it. It was working properly before but i m trying the code in different pc now and it waits and gives lots of random characters along with some succesfull prints. I will put the code and the outcome now:

#include <SPI.h>
#include <Ethernet2.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = {0x90, 0xA2, 0xDA, 0x10, 0x18, 0x7B};
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
char server[] = "airbotest.com";    // name address for Google (using DNS)
char path[] = "/GetTask_1002.aspx";
static String TaskList;
static String tmpTaskList;

static int TaskFlag=0;
String getTask();
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(10, 20, 1, 2);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;


void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  
  Serial.println("deneme - deneme");
  Serial.println(getTask());
  if(getTask()=="NoTask"){
    Serial.println("there is no task");
  }
  
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
}
void loop() {
  
  

  
  
}

String getTask(){
//---------------
  tmpTaskList = "";
  TaskList = "";
  TaskFlag=0;
  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    
    Ethernet.begin(mac, ip);
  }
  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("connecting...");
  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("connected");
    // Make a HTTP request:
    
    client.print("GET ");
    client.print(path);
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(server);
    client.println("Connection: close");
    client.println();
    
    
  } else {
    // if you didn't get a connection to the server:
    Serial.println("connection failed");
  }
  
  
  
  // if there are incoming bytes available
  // from the server, read them and print them:
 
  while (client.available() || client.connected())
  {
    // if there are incoming bytes available from the server, read them
                if (client.available()){
                        char c = client.read();
                        
                        tmpTaskList += String(c);
                        Serial.println (tmpTaskList);
                }
                if (!client.available() && !client.connected()){
                    
                        for (int i=0;i < tmpTaskList.length();i++){
                                if(TaskFlag == 0){
                                        if(String(tmpTaskList[i]) == "#"){
                                                TaskFlag = 1;
                                        }
                                }else if(TaskFlag==1){
                                        if(String(tmpTaskList[i]) != "#"){
                                                TaskList += String(tmpTaskList[i]);
                                        }else {
                                                TaskFlag = 2;
                                        }
                                }
                        }
                        
                        client.stop();
                        
   return TaskList;  
  }
 }
}

here comes the serial.monitor output:

deneme - deneme
connecting...
connection failed
Æ×yåGŞŞ�İ'åMå+íé1UîŞâø·öhÌß÷]>Şkl‚o¢ò�ƒëÓ9½ËúüûyıõwÿpXoIÚÿïï(�şÆúş·¼íõPÎñınP_^¿uóµñì_¾ïe�oìÉ·ûûoÜ÷É«L·²ÿÛŸuv�Ú×ÿûï=w~ÑÓğ¾é¼gî®oë;™˜ïgw;�yôş­şÍ?{�ᄀ½�[?ßù=ş×ÿyaBPôıs¼¶ğ÷×çb
óÿÿ

There goes stuff like that somehow i couldnt copy paste them all…

  Serial.println(getTask());
  if(getTask()=="NoTask"){

Why are you calling getTask() twice to get the ONE task?

  while (client.available() || client.connected())
  {

You do this regardless of whether you successfully connected, or not. Why?

   return TaskList;  
  }
 }

EVERY path needs to return a value, not just some of them.