I have a Drupal Views 2 view that returns a number of fields for some nodes as JSON. I can view it in Chrome, and it has everything I expect.
When I download it on my Windows Phone 7 app, one field, "field_images_nid" is mysteriously missing from the response. What could have caused this? Does Drupal not send that field because of some user agent data on WP7's WebClient
?
WebClient data = new WebClient();
data.DownloadStringCompleted += new DownloadStringCompletedEventHandler(onComplete);
data.DownloadStringAsync(new Uri(dataUri));
The field in question is a link to an image associated with the node. Views refers to it as "Content: Images Full Node".
Update: I made a new test app that does nothing but make the request so I can view the result in a debugger:
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
Loaded += new RoutedEventHandler(MainPage_Loaded);
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(new Uri("http://path/to/service"));
}
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
string result = e.Result;
}
}
I made a new view that does nothing but return "Title" and "Content: Images (full node)" for a given nid. I am able to observe the same incongruence between the Chrome and WP7 request.
Update 2: When I go to the views url in Chrome incognito, the field is not returned. Perhaps there is a permissions issue at work? I thought the field should be anonymously available.