I am using the twitter oauth and i can get follower count for given user, i am now trying to get timeline for given user via webapi. When i step through code in my service where i get the timeline i definately have items with content however on front end i get emtpy twitterstatusmessage, see attached image.
May I ask what this is going to be used for? And is XML the desired output format?
The reason I'm asking is that WebApi by default will have an XML serializer and a JSON serializer - which one is used for the response depends on the accept header of the request.
I'm not very familiar with the XML serializer used in WebApi, since I haven't yet had a use case where I needed it, so I don't think I'll be able to help much with that one.
Of course depending on your use case, you can use the JavaScript serializer in WebApi instead. If you use $.getJSON in jQuery, it will automatically send the correct accept header so the JSON serializer will be used. When using the JSON serializer, the properties are listed correctly.
An extra tip: If you only need JSON, you can use this package to force the output be the JSON: https://github.com/abjerner/Skybrud.WebApi.Json (saves a lot of headaches when testing and debugging, since you don't have to send an accept header).
Timeline from webapi
Hello,
I am using the twitter oauth and i can get follower count for given user, i am now trying to get timeline for given user via webapi. When i step through code in my service where i get the timeline i definately have items with content however on front end i get emtpy twitterstatusmessage, see attached image.
Regards
Ismail
Hi Ismail,
May I ask what this is going to be used for? And is XML the desired output format?
The reason I'm asking is that WebApi by default will have an XML serializer and a JSON serializer - which one is used for the response depends on the accept header of the request.
I'm not very familiar with the XML serializer used in WebApi, since I haven't yet had a use case where I needed it, so I don't think I'll be able to help much with that one.
Of course depending on your use case, you can use the JavaScript serializer in WebApi instead. If you use $.getJSON in jQuery, it will automatically send the correct accept header so the JSON serializer will be used. When using the JSON serializer, the properties are listed correctly.
Anders,
Need json i will take out the xml one see if that fixes issue.
Cheers
Ismail
An extra tip: If you only need JSON, you can use this package to force the output be the JSON: https://github.com/abjerner/Skybrud.WebApi.Json (saves a lot of headaches when testing and debugging, since you don't have to send an accept header).
Anders,
This works a treat many thanks.
Ismail
is working on a reply...