Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string proposal_url = "http://sandbox4.eureeca.com/Crowd-funding-pages/FrontEnd/Pitch/crowd-investment-pitch.aspx?PID=" + message;
- var accessToken = HttpContext.Current.Session["AccessToken"].ToString();
- string postData = "&proposal=" + HttpUtility.UrlEncode(proposal_url);
- postData += "&method=post";
- postData += "&fb%3Aexplicitly_shared=true";
- string action = "https://graph.facebook.com/me/eureecafb:follows?access_token=" + accessToken;
- // HttpContext.Current.Response.Redirect(action+postData);
- ExecuteHttpActionPost(action, postData);
- public static string ExecuteHttpActionPost(string Action, string postData)
- {
- ErrHandler err = new ErrHandler();
- ASCIIEncoding encoding = new ASCIIEncoding();
- byte[] data = encoding.GetBytes(Action + postData);
- // err.WriteError(Action + "///" + data);
- WebRequest request = WebRequest.Create(Action + postData);
- request.Method = "post";
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = data.Length;
- Stream newStream = request.GetRequestStream();
- //// Send the data.
- newStream.Write(data, 0, data.Length);
- newStream.Close();
- WebResponse resp = request.GetResponse();
- StreamReader sr = new StreamReader(resp.GetResponseStream());
- string result = sr.ReadToEnd();
- resp.Close();
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement