Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6371065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:00:43+00:00 2026-05-25T01:00:43+00:00

Sorry if the question I am asking makes nonsense as I am really new

  • 0

Sorry if the question I am asking makes nonsense as I am really new to this. 🙁

I have a project which is already using Hammock for oAuth (version 1.0) authentication. And then I saw Shawn Burke’s awesome data caching framework AgFx and I really want to be able to use it within my project.

But the problem I am having is, with Hammock I can easily make a request by using

var request = new RestRequest
{
    Credentials = _credentials,
    Path = "/fav.xml",
    Method = WebMethod.Post
};

where I store access token, consumer key, etc. in the _credentials object. And it does its magic for me so I don’t need to convert them into the long oauth signature string.

But with AgFx, my understanding is, I need to use WebLoadRequest to request for the data, which looks like this

return new WebLoadRequest(loadContext, new Uri(myUri), "POST", "post-data");

where “post-data” should be the oauth signature string. Then basically I need to throw away what Hammock gives to me and rewrite the code to get the signature.

I just wonder if there’s a better way of doing this? Or should I say if there’s a libary I can use to get this signature easily?

Any help would be much appreciated!!

Cheers,

Xin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:00:44+00:00Added an answer on May 25, 2026 at 1:00 am

    I have figured it out.

    Shawn Burke who created this framework pointed me to the right direction.

    Bisically what I’ve done is I create a HammockLoadRequest which inherits from AgFx’s LoadRequest, and in the Execute override, replace the HttpWebRequest with Hammock’s RestRequest and that’s it.

        public class HammockLoadRequest : LoadRequest
    {
        public OAuthCredentials Credentials { get; set; }
        public string AuthorityUrl { get; set; }
    
        /// <summary>
        /// Create a HammockLoadRequest
        /// </summary>
        public HammockLoadRequest(LoadContext loadContext, OAuthCredentials credentials, string authorityUrl)
            : base(loadContext)
        {
            Credentials = credentials;
            AuthorityUrl = authorityUrl;
        }
    
        /// <summary>
        /// Performs the actual get for this request.
        /// </summary>
        /// <param name="result"></param>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
        public override void Execute(Action<LoadRequestResult> result)
        {
            PriorityQueue.AddNetworkWorkItem(
                () =>
                {
                    var client = new RestClient
                    {
                        Authority = this.AuthorityUrl,
                        HasElevatedPermissions = true
                    };
    
                    var restRequest = new RestRequest
                    {
                        Credentials = this.Credentials,
                        Path = "/xxx.json",
                    };
    
                    restRequest.AddParameter("count", "5");
                    restRequest.AddParameter("include_rts", "1");
                    //if (sinceId != 0)
                    //    request.AddParameter("since_id", sinceId.ToString());
    
                    RestCallback responseHandler = (request, response, userstate) =>
                    {
                        if (response.StatusCode != HttpStatusCode.OK)
                        {
                            Helpers.ShowMessage(String.Format("Error Getting Status: {0}", response.StatusCode));
                            return;
                        }
    
                        // convert string to stream
                        byte[] bytes = Encoding.UTF8.GetBytes(response.Content);
                        var stream = new MemoryStream(bytes);
                        stream.Close();
                        result(new LoadRequestResult(new MemoryStream(bytes)));
                        return;
                    };
    
                    client.BeginRequest(restRequest, responseHandler);
                });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for asking such a vague question, i'm new to using C# / ASP.NET.
I apologize in advance for asking this question, I know similar questions have already
Sorry for asking a stupid question but I have a problem that makes me
am sorry for this question, but i was asking: when using MD5, we get
[edit]: I'm terribly sorry for my timing on asking this question. I've just discovered
I am new to Cstring, sorry for asking dumb question, please help. char string[10];
sorry for asking this dumb question i will try to explain as good as
Sorry for asking a totally basic question, but if I have a synthesized property
Sorry for asking a rather n00b question, I am rather new to ASP.NET MVC.
Sorry for asking a basic question like this but I've been reading on this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.