Hi!,
i’m starting to use HttpClient library for Photon, and i am having some problems with the request.body field. I’m implementing the following code:
request.hostname = "paradas.guaguas.com";
request.port = 80;
request.path = "/387";
http.get(request, response, headers);
// Response Status
Serial.print("Application>\tResponse status: ");
Serial.println(response.status);
//Response Body
Serial.print("Application>\tHTTP Response Body: ");
Serial.println(response.body);
… and i obtain the following output:
> U:\>particle serial monitor COM6
> Opening serial monitor for com port: "COM6"
> Application> Response status: 200
> Application> HTTP Response Body: <!DOCTYPE html>
> <html>
> <head>
<title>ParadasGuaguas</title>
<meta http-equiv="refresh" content="25" />
<link href="/assets/application-e1e25f5530998b76317739a1762b3401.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/application-b0c8d6f979453c7361c3d79fffecb05a.js" type="text/javascript"
… but it is incomplete, since when i perform the same request, but using curl, i obtain the following output:
U:\>curl -GET "http://paradas.guaguas.com/387"
<!DOCTYPE html>
<html>
<head>
<title>ParadasGuaguas</title>
<meta http-equiv="refresh" content="25" />
<link href="/assets/application-e1e25f5530998b76317739a1762b3401.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/application-b0c8d6f979453c7361c3d79fffecb05a.js" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="qXkgejKVGY16zUA53Yet7S8LLSrAYuq1KUrrZzWTrQw=" name="csrf-token" />
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<title>Guaguas Municipales</title>
<link href='/stylesheets/guaguas-m.css' rel='stylesheet' type='text/css'>
</head>
<body>
<div id='container'>
<div id='header'>
<div class='logo'>
<img src='/images/guaguas_logoparatodos.png'>
</div>
</div>
<div id='main'>
<div class='content'>
<h1>ACCESO MANUEL DE FALLA</h1>
<table summary='Líneas que pasan por la parada X'>
<thead>
<tr>
<th class='linea'>Línea</th>
<th class='destino'>Destino</th>
<th class='tiempo'>Llegada</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class='linea-82'>82</span>
</td>
<td>TEATRO</td>
<td>1min</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id='footer'>
<div class='timestamp'>
Actualizado
<span>11:21:35</span>
</div>
</div>
</div>
</body>
</html>
</body>
</html>
… any clue about which is the problem, and how can i make that request.body contains the full response text?
thanks