arduino does not extract json from laravel website

i am making a website with laravel to communicate with arduino
the arduino sends a personalized url with information and the website resumes a json with the response information
when I put the sample data in a simple test.json file the arduino will check the data but if a response to the url of a view with the json array is placed on the site in laravel it does not detect …

controller:

return view('cartaojson');

view:

{
"coord": {
"lon": -8.61,
"lat": 41.15
},
"weather": [
{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}
],
"base": "stations",
"main": {
"temp": 296.15,
"pressure": 1020,
"humidity": 69,
"temp_min": 296.15,
"temp_max": 296.15
},
"visibility": 10000,
"wind": {
"speed": 4.6,
"deg": 320
},
"clouds": {
"all": 0
},
"dt": 1499869800,
"sys": {
"type": 1,
"id": 5959,
"message": 0.0022,
"country": "PT",
"sunrise": 1499836380,
"sunset": 1499890019
},
"id": 2735943,
"name": "Porto",
"cod": 200
}

arduino:

bool skipResponseHeaders() {
  // HTTP headers end with an empty line
  char endOfHeaders[] = "\r\n\r\n";

  client.setTimeout(HTTP_TIMEOUT);
  bool ok = client.find(endOfHeaders);

  if (!ok) {
    Serial.println("No response or invalid response!");
  }
  return ok;
}

// Parse the JSON from the input string and extract the interesting values
// Here is the JSON we need to parse


bool readReponseContent(struct clientData* clientData) {
  // Compute optimal size of the JSON buffer according to what we need to parse.
  // See https://bblanchon.github.io/ArduinoJson/assistant/
  const size_t bufferSize = JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(1) + 
      2*JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(4) + JSON_OBJECT_SIZE(5) + 
      JSON_OBJECT_SIZE(6) + JSON_OBJECT_SIZE(12) + 390;
  DynamicJsonBuffer jsonBuffer(bufferSize);

  JsonObject& root = jsonBuffer.parseObject(client);

  if (!root.success()) {
    Serial.println("JSON parsing failed!");
    return false;
  }

serial arduino with laravel

Ethernet ready
A obter informação por favor aguarde...
 69 F5 ED 6EConnect to pap.hyperchip.pt
Connected
GET /cartao/f/f/f
JSON parsing failed! /// fail in website laravel
Disconnect

arduino in website file .json or .html too works in html

Connected
GET /arduino/teste.json   works
Temp = 296.15
Humidity = 69
Acesso negado
Disconnect

parcial code:

#include <ArduinoJson.h>
#include <Ethernet.h>
#include <SPI.h>
#include <MFRC522.h>
    
#define RED 2
#define GREEN 3
#define BLUE 2
#define SS_PIN 8
#define RST_PIN 7

const int BUZZER = 9;
char porta[100]  = "1";
char key[100]  = "xxxxx";
MFRC522 mfrc522(SS_PIN, RST_PIN); 
EthernetClient client;
// Name address for Open Weather Map API
const char* server = "pap.hyperchip.pt";
// Replace with your unique URL resource
const char* resource = "/cartao/arduino/arduino/arduinon";
// How your resource variable should look like, but with your own COUNTRY CODE, CITY and API KEY (that API KEY below is just an example):
//const char* resource = "/data/2.5/weather?q=Porto,pt&appid=bd939aa3d23ff33d3c8f5dd1";
const unsigned long HTTP_TIMEOUT = 10000;  // max respone time from server
const size_t MAX_CONTENT_SIZE = 512;       // max size of the HTTP response
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
// The type of data that we want to extract from the page
struct clientData {
  char temp[8];
  char humidity[8];
};
    
// ARDUINO entry point #1: runs once when you press reset or power the board
void setup() {
  pinMode(RED , OUTPUT);
  pinMode(GREEN , OUTPUT);
  pinMode(BLUE , OUTPUT);
  pinMode(BUZZER, OUTPUT);
      
  Serial.begin(9600);
  while (!Serial) {
    ;  // wait for serial port to initialize
  }
  Serial.println("Serial ready");
  
  /////teste
  Serial.print(F("Starting ethernet..."));
  if (!Ethernet.begin(mac)) {
    Serial.println(F("failed"));
  } else {
    Serial.println(Ethernet.localIP());
  }

  //teste ip
  mfrc522.PCD_Init();   // inicializa o  MFRC522
  if (!Ethernet.begin(mac)) {
    Serial.println("Failed to configure Ethernet");
    return;
  }
  Serial.println("Ethernet ready");
  delay(1000);
}
    
// ARDUINO entry point #2: runs over and over again forever
void loop() {
  if (connect(server)) {
    if (sendRequest(server, resource) && skipResponseHeaders()) {
      clientData clientData;
      if (readReponseContent(&clientData)) {
        printclientData(&clientData);
      }
    }
  }
  disconnect();
  wait();
  Serial.println("UID tag:"); // Mostra no serial a UID tag do cartão
  Serial.print(content.substring(1));
  Serial.println();
}
    
// Open connection to the HTTP server
bool connect(const char* hostName) {
  Serial.print("Connect to ");
  Serial.println(hostName);
    
  bool ok = client.connect(hostName, 80);
  Serial.println(ok ? "Connected" : "Connection Failed!");
  return ok;
}
    
// Send the HTTP GET request to the server
bool sendRequest(const char* host, const char* resource) {
  Serial.print("GET ");
  Serial.println(resource);
  if (client.connect(server, 80)) {
    client.print("GET ");
    client.print(resource);
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(host);
    client.println("Connection: close");
    client.println();
  } else {
    // if you didn't get a connection to the server:
    Serial.println("connection failed");
  }
  return true;
}
    
// Skip HTTP headers so that we are at the beginning of the response's body
bool skipResponseHeaders() {
  // HTTP headers end with an empty line
  char endOfHeaders[] = "\r\n\r\n";
  client.setTimeout(HTTP_TIMEOUT);
  bool ok = client.find(endOfHeaders);
  if (!ok) {
    Serial.println("No response or invalid response!");
  }
  return ok;
}
    
// Parse the JSON from the input string and extract the interesting values
// Here is the JSON we need to parse
bool readReponseContent(struct clientData* clientData) {
  // Compute optimal size of the JSON buffer according to what we need to parse.
  // See https://bblanchon.github.io/ArduinoJson/assistant/
  const size_t bufferSize = JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(1) + 2 * JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(4) + JSON_OBJECT_SIZE(5) + JSON_OBJECT_SIZE(6) + JSON_OBJECT_SIZE(12) + 390;
  DynamicJsonBuffer jsonBuffer(bufferSize);
  JsonObject& root = jsonBuffer.parseObject(client);
    
  if (!root.success()) {
    Serial.println("JSON parsing failed!");
    return false;
  }
    
  // Here were copy the strings we're interested in using to your struct data
  strcpy(clientData->temp, root["main"]["temp"]);
  strcpy(clientData->humidity, root["main"]["humidity"]);
  // It's not mandatory to make a copy, you could just use the pointers
  // Since, they are pointing inside the "content" buffer, so you need to make
  // sure it's still in memory when you read the string
  return true;
}
    
// Print the data extracted from the JSON
  void printclientData(const struct clientData* clientData) {
  Serial.print("Temp = ");
  Serial.println(clientData->temp);
  Serial.print("Humidity = ");
  Serial.println(clientData->humidity);
  if (clientData->humidity == " 69") { //change here the UID of the card/cards that you want to give access
    digitalWrite(GREEN, HIGH); //liga led vermelho
    Serial.println("Acesso Autorizado, bem vindo");
    tone(BUZZER, 700); // 0,7KHz som digital
    delay(400);
    noTone(BUZZER);  
    delay(400); 
    tone(BUZZER, 700); // 0,7KHz som digital
    delay(400);           
    noTone(BUZZER);     // para som   
    digitalWrite(GREEN, LOW); // desliga led vermelho
    delay(3000);
  } else {
    tone(BUZZER, 1000); // 1KHz som digital
    digitalWrite(RED, HIGH); //liga led vermelho
    Serial.println("Acesso negado");
    delay(1000);        // 1 segundo
    noTone(BUZZER);     // para som   
    digitalWrite(RED, LOW); // desliga led vermelho
    delay(3000);
  }
}
    
// Close the connection with the HTTP server
void disconnect() {
  Serial.println("Disconnect");
  client.stop();
}
    
// Pause for a 1 minute
void wait() {
  Serial.println("Wait 60 seconds");
  delay(2000);
}

Does it work if you parse the JSON using the assistant code?

the assistant code?
which more specifically?

Posting partial code is not helping us help you. Which type of arduino are you using? Have you tested if there is enough memory for the operation?

i using the arduino uno, yeas i think have beacause the only thing that changes is that it is replaced instead of if a simple "site" with only the .json or .html file is the site in laravel but the return should be the same ...

mica_g:
the assistant code?
which more specifically?

I posted a link in my reply to the assistant. If you paste the JSON code the website relies with into the assistant you get example code snippets on how to parse it.
Pasting the JSON from view: in your initial post gives the below. This is assuming your using an AVR board but you had best run the assistant and tweak it to your setup as it also suggests data structure size and usage.

const char* json = "{\"coord\":{\"lon\":-8.61,\"lat\":41.15},\"weather\":[{\"id\":800,\"main\":\"Clear\",\"description\":\"clear sky\",\"icon\":\"01d\"}],\"base\":\"stations\",\"main\":{\"temp\":296.15,\"pressure\":1020,\"humidity\":69,\"temp_min\":296.15,\"temp_max\":296.15},\"visibility\":10000,\"wind\":{\"speed\":4.6,\"deg\":320},\"clouds\":{\"all\":0},\"dt\":1499869800,\"sys\":{\"type\":1,\"id\":5959,\"message\":0.0022,\"country\":\"PT\",\"sunrise\":1499836380,\"sunset\":1499890019},\"id\":2735943,\"name\":\"Porto\",\"cod\":200}";

DynamicJsonDocument doc(512);
deserializeJson(doc, json);

float coord_lon = doc["coord"]["lon"]; // -8.61
float coord_lat = doc["coord"]["lat"]; // 41.15

JsonObject weather_0 = doc["weather"][0];
int weather_0_id = weather_0["id"]; // 800
const char* weather_0_main = weather_0["main"]; // "Clear"
const char* weather_0_description = weather_0["description"]; // "clear sky"
const char* weather_0_icon = weather_0["icon"]; // "01d"

const char* base = doc["base"]; // "stations"

JsonObject main = doc["main"];
float main_temp = main["temp"]; // 296.15
int main_pressure = main["pressure"]; // 1020
int main_humidity = main["humidity"]; // 69
float main_temp_min = main["temp_min"]; // 296.15
float main_temp_max = main["temp_max"]; // 296.15

int visibility = doc["visibility"]; // 10000

float wind_speed = doc["wind"]["speed"]; // 4.6
int wind_deg = doc["wind"]["deg"]; // 320

int clouds_all = doc["clouds"]["all"]; // 0

long dt = doc["dt"]; // 1499869800

JsonObject sys = doc["sys"];
int sys_type = sys["type"]; // 1
int sys_id = sys["id"]; // 5959
float sys_message = sys["message"]; // 0.0022
const char* sys_country = sys["country"]; // "PT"
long sys_sunrise = sys["sunrise"]; // 1499836380
long sys_sunset = sys["sunset"]; // 1499890019

long id = doc["id"]; // 2735943
const char* name = doc["name"]; // "Porto"
int cod = doc["cod"]; // 200