Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-05

TFPHTTPServer and POST method with JSON content

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

JB

Hi guys,

I'm trying to implement a simple server that responds to calls JSON (JSON RPC). I'm using this tutorial
http://www.freepascal.org/~michael/articles/webserver1/webserver1.pdf

Works well, but does not recognize POST methods sent as JSON, only recognizes when sending HTTP forms.

When I try to send a JSON call, the server receives an OPTION method.

In lazarus projects wizards and brook framework wizards work fine, with the actions and same JSON call.

I use ajax with json dataType and contentType application/json.

I need charge contents types on server? I need to implement something more? What could be wrong?

Thanks

Best regards

Jos? Benedito
JBS Solu??es
Consulting Systems Development
c
www.jbsolucoes.net

skype:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140522/3a20e8ce/attachment.html>

Reply by email

JB
to JB

Hi, it seems that the bug is on Chrome and Firefox with ajax POST request

http://bugs.jquery.com/ticket/13758

but as I will use with components in lazarus is working.

Thanks

Jos? Benedito
JBS Solu??es
Consulting Systems Development
c
www.jbsolucoes.net

skype:

JB wrote 31 lines
Hi guys, I'm trying to implement a simple server that responds to calls JSON (JSON RPC). I'm using this tutorial http://www.freepascal.org/~michael/articles/webserver1/webserver1.pdf Works well, but does not recognize POST methods sent as JSON, only recognizes when sending HTTP forms. When I try to send a JSON call, the server receives an OPTION method. In lazarus projects wizards and brook framework wizards work fine, with the actions and same JSON call. I use ajax with json dataType and contentType application/json. I need charge contents types on server? I need to implement something more? What could be wrong? Thanks Best regards Jos? Benedito JBS Solu??es Consulting Systems Development c www.jbsolucoes.net skype:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140522/bf9a18bb/attachment.html>

Reply by email