400 bad request help

serial monitor said

+⸮⸮a⸮⸮) 'NN⸮P/1.1 400 Bad Request
Date: Fri, 25 Oct 2019 06:37:52 GMT
Server: Apache/2.4.38 (Raspbian)
Content-Length: 305
Connection: close
Content-Type: text/html; charset=iso-8859-1

xѵ⸮⸮BˈW⸮&L⸮⸮Re⸮⸮⸮z⸮E⸮⸮

Bad Request

Your browser sent a request that this server could not understand.


Apache/2.4.38 (Raspbian) Server at 127.0.1.1 Port 8080 3,CLOSED link is not valid

ERROR
Data packet send error (2)[WiFiEsp] Failed to write to socket 3
[WiFiEsp] Disconnecting 3
UNLINK

ERROR

=====================================

arduino code

if(espclient.connect(server,8080)){
Serial.println(F(“Connection Established 2”));
espclient.println(“POST /insertstate.php?state=”+state+"&tst="+tst+" HTTP/1.1");
espclient.println(F(“Host: 192.168.0.5”));
espclient.println(F(“Content-Type: application/x-www-form-urlencoded; charset=UTF-8”));
espclient.println(F(“Connection: close”));
espclient.println();
espclient.println();
espclient.flush();
espclient.stop();

==========================

php

$con=~

$state=$_GET[“state”]
$tst=$_GET[“tst”];

$sql=“update ~ set state=’$state’ where nfc=’$tst’”;
mysqli_query($con, $sql);
mysqli_close($con);

arduino sent value used this code
GET /insertstate.php?state="+state+" HTTP/1.1

but GET /insertstate.php?state="+state+"&tst="+tst+" HTTP/1.1
is not working POST too

i cant solved this problem
how to fix it?

i tried \r\n, Content-Type: application/x-www-form-urlencoded; charset=UTF-8, etc…
help me please

Please post you sketch within </> code tags, and post a complete sketch
when you make the requestespclient.println("POST /insertstate.php?state="+state+"&tst="+tst+" HTTP/1.1");there is a space in the sent URL, there should not be. try espclient.println("POST /insertstate.php?state="+state+"&tst="+tst+"%20HTTP/1.1");or leave the HTTP/1.1 out altogether.

What is the value of "state" and "tst"? A "POST" request implies a body to be posted, but you are not doing so..

@bygnim

Please READ THIS POST then you will know NOT to use the REPORT TO MODERATOR as a reply option.

Bob.