If you access a page with the ?packet responder as in http://myFitNesseHost/MyPage?packet you will get back a JSON packet that represents the tables on that page. Only the tables will be part of the packet, any other text is ignored. The JSON packet begins with an array named tables. Each element of that array corresponds to a table on the page. The tables use an indentation style to represent the packets. For example:
If you get the packet for this page by accessing http://localhost:80/FitNesse.UserGuide.RestfulPackets?packet you will get the following JSON packet:
Customer | |||
name | Bob Someone | ||
id | 8402 | ||
addr | |||
Street | 555 Witherspoon st. | ||
city | Anyville | ||
state | IL | ||
zip | 60083 | ||
phone | 555-1212 |
If you get the packet for this page by accessing http://localhost:80/FitNesse.UserGuide.RestfulPackets?packet you will get the following JSON packet:
{"tables": [
{"Customer":
{ "addr":
{ "Street": "555 Witherspoon st.",
"city": "Anyville",
"state": "IL",
"zip": "60083"
},
"id": "8402",
"name": "Bob Someone",
"phone": "555-1212"
}
}
]}
JSONP
If you'd like to use JSONP to fetch the packets. (Or any kind of script injection tecnique). You can get fitnesse to return the appropriate format by adding &jsonp=some_function on the end of the url. This will wrap the JSON packet in a function call that looks like this some_function({...}) So, for example, try this link: http://localhost:80/FitNesse.UserGuide.RestfulPackets?packet&jsonp=load_me.Add Child Page to RestfulPackets