JSON objects sent as a http request

  • Follow


Hi,

I'm not sure if this question even makes sense, so bear with me here.

I'm using a tool called HtmlUnit (which is like JUnit) to send a http
request to my web application. The http address needs to include JSON
objects because the JavaScript/Java functions at the web application
are expecting to receive them as parameters.

Let me clarify:

suppose the web app servlet has a (Java) function:

boolean myfunction(JSONObject myobject)

and I want to call it from an outside test using Html, how do I do
this?

I want to send a request like "http://localhost/json/<path>/
myfunction" and then put the JSON object stuff at the end of the http
line so that the function myfunction accepts it as the parameter
myobject.

How do I do this? Can it be done? Is this "the way" to send such
objects to such functions?

Thanks for your help. Any info would be appreciated.

Mark Spezzano
0
Reply valheru 2/20/2008 5:17:21 AM

valheru@chariot.net.au wrote:

> boolean myfunction(JSONObject myobject)
> 
> and I want to call it from an outside test using Html, how do I do
> this?

I dunno about HTML, but this might help if you need to use Java:

http://www.json.org/java/

Why do you need to use HTML?  What's wrong with Java or HTMLUnit?

0
Reply Mark 2/20/2008 5:38:10 AM


1 Replies
605 Views

(page loaded in 0.031 seconds)

Similiar Articles:













7/24/2012 2:38:10 AM


Reply: