Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] JSON, PHP e MySQL não mostra dados

Talvez o Slim Framework te ajude também.


Em 27 de janeiro de 2015 13:19, luciofm <luciofm@gmail.com> escreveu:
Por favor marcar perguntas Off topic como tal...


On Tue Jan 27 2015 at 3:17:39 PM Ernani Joppert Pontes Martins <joppert@gmail.com> wrote:
Use a lib httpful, é uma mão na roda...


O seu problema está no request header mime type

O cabeçalho http requer que seja enviado em text/json em alguns casos...

Essa lib te ajuda nisso, e o código fica bem mais limpo, e vc consegue definir tempo de timeout, etc.

Com ela vc pode usar algo assim:

 $uri = 'http://seusite/suaapi/seumetodo'; $timeout = 30; $body = '{"nome": "valor"}'; $response = \Httpful\Request::post($uri) ->timeoutIn($timeout)->body($body) ->sendsJson()->expectsJson()->send();

Abraço,

Ernani

2015-01-27 13:00 GMT-02:00 Cleidimar Viana <cleidimarviana@gmail.com>:

Obrigado Henrique, acabei de encontrar o "erro", do porque não aparecer os dados. O arquivo php estava com assinatura Unicode (BOM). Que ódio, perdi dois por isso! 


Att.
Cleidimar V. Santos
Software Developer e Co-fundador da Workingbox
Graduando em Ciência da Computação - UFMS/CPPP

On Tue, Jan 27, 2015 at 12:57 PM, Henrique Melo <henrique1985@gmail.com> wrote:
Tente especificar o mime-type da pagina gerada em php para o tipo JSON ou TXT.



2015-01-27 10:54 GMT-04:00 Cleidimar Viana <cleidimarviana@gmail.com>:

Não entendi, desculpa!


Att.
Cleidimar V. Santos
Software Developer e Co-fundador da Workingbox
Graduando em Ciência da Computação - UFMS/CPPP

On Tue, Jan 27, 2015 at 12:53 PM, Henrique Melo <henrique1985@gmail.com> wrote:

Mime -type?

Em 27/01/2015 10:42, "Cleidimar Viana" <cleidimarviana@gmail.com> escreveu:
Boa Tarde Pessoal,

estou com um problema estranho com o JSON. Estou desenvolvendo um sistema e não consigo ler o JSON a partir de um arquivo php, porém se coloco os mesmos dados gerado do PHP em um arquivo txt, funciona. Alguém já deparou com esse problema?!

Att. Cleidimar Viana

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/androidbrasil-dev/CWnIYfujsv8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Henrique Nogueira de Melo
Analista e Arquiteto de Software

--
You received this message because you are subscribed to a topic in the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/androidbrasil-dev/CWnIYfujsv8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário