Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2008

Tip: Looking for answers? Try searching our database.

JSON objects sent as a http request

Thread view: 
valheru@chariot.net.au - 20 Feb 2008 05:17 GMT
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
Mark Space - 20 Feb 2008 05:38 GMT
> 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?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.