TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rakesh Kurkundikar
NA
1
752
Please can anyone tel how can i send data to openshift cloud
Feb 12 2015 4:46 AM
mine code contain a class called Httpmethod which does sending and response of data to cloud but its giving error as
The remote server returned an error: (404) Not Found. plzz can any help..
and the method of button send contain
Httpmethod myRequest = new Httpmethod("http://mynode-loomproject.rhcloud.com", "POST", "a=fname&b=lname&c=email&d=contact&e=pass&f=cpass");
Console.WriteLine(myRequest.GetResponse());
class Httpmethod
{
private WebRequest request;
private Stream dataStream;
private string status;
public String Status
{
get
{
return status;
}
set
{
status = value;
}
}
public Httpmethod(string url, string method, string data): this(url, method)
{
try
{
string postData = data;
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
}
catch (WebException ex)
{
MessageBox.Show(ex + " ");
}
dataStream.Close();
}
public string GetResponse()
{
WebResponse response = request.GetResponse();
this.Status = ((HttpWebResponse)response).StatusDescription;
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
return responseFromServer;
}
}
}
thank u advance..
Reply
Answers (
0
)
How do I design a form like this ...
Dashboard