1

Sorry my English is poor.

I use nodemcu to get a json data.

By this String alldata = client.readString();

But it turn this:

  HTTP/1.1 200 OK
  Server: nginx
  Date: Sat, 10 Aug 2019 04:53:16 GMT
  Content-Type: application/json; charset=utf-8
  Content-Length: 152
  Connection: keep-alive
  X-RateLimit-Limit-day: 20000
  X-RateLimit-Remaining-day: 19968
  Cache-Control: no-cache
  Pragma: no-cache
  Expires: -1
  X-Powered-By: ASP.NET
  Access-Control-Allow-Origin: *
  X-Kong-Upstream-Latency: 23
  X-Kong-Proxy-Latency: 2
  Via: kong/0.14.1
  Strict-Transport-Security: max-age=63072000; includeSubdomains; preload

  [{"Direction":0,"EstimateTime":364,"StopStatus":0,"MessageType":0,"SrcUpdateTime":"2019-08-10T12:53:00+08:00","UpdateTime":"2019-08-10T12:53:05+08:00"}]

I need '364' to display on oled.

Is it possible to split it.Thanks!

3
  • 1
    yes it is possible to extract the value ... google arduino parsing strings
    – jsotola
    Aug 11, 2019 at 3:16
  • cut away the HTTP headers (until the empty line). use ArduinoJson library to parse the payload
    – Juraj
    Aug 11, 2019 at 10:33
  • Thanks I have solve it.
    – Memba
    Aug 26, 2019 at 9:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.