0

I am working with some code originally written by someone else, using the Symfony2 framework to create routes in the form:

http://my_site.com/account/add
http://my_site.com/account/delete, etc.

The problem is that if I have something like this:

http://my_site.com/account/add/{"account_id":"test","web_site":"http://www.another_site.com"}

I am urlencoding the JSON string before sending it, but I am getting a 404 (route not found)

if I remove the http:// it works fine

Even if I do something like:

http://my_site.com/account/add/{"account_id":"test","web_site":"www.another_site.com/funstuff"}

I also get a 404 , with a message about route not found, which I assume comes from the symfony2 framework. Any ideas?

4

2 回答 2

3

我将在这里猜测一下,并建议尝试在请求正文中通过 POST 发送 JSON。我从未见过需要将 JSON 放入 URL 的东西。

于 2012-11-16T20:46:20.340 回答
0

你为什么要传递 GET 而不是 POST。当数据发送到服务器导致服务器上的数据发生变化时,通常使用 post。

于 2012-11-16T20:46:24.127 回答