Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Dec 04, 2014 @ 12:52
    Ismail Mayat
    0

    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

  • Anders Bjerner 476 posts 2885 karma points MVP 6x admin c-trib
    Dec 04, 2014 @ 13:57
    Anders Bjerner
    0

    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.

  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Dec 04, 2014 @ 14:08
    Ismail Mayat
    0

    Anders,

    Need json i will take out the xml one see if that fixes issue.

    Cheers

    Ismail

  • Anders Bjerner 476 posts 2885 karma points MVP 6x admin c-trib
    Dec 04, 2014 @ 14:14
    Anders Bjerner
    100

    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).

  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Dec 04, 2014 @ 17:11
    Ismail Mayat
    0

    Anders,

    This works a treat many thanks.

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft