Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 132,180 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,456 people online right now. Registration is fast and FREE... Join Now!




Webservice POST request

 
Reply to this topicStart new topic

Webservice POST request, Webservice REST call

the_ro_show
post 7 Oct, 2008 - 10:19 AM
Post #1


New D.I.C Head

*
Joined: 7 Oct, 2008
Posts: 1

Good afternoon,

I'm having trouble calling the post method using REST calls with a webservice.

I would like to send an atom entry document containing my new information to a webservice using APIs.

I already have the URI, and have gotten as far as:


HttpWebRequest new_request = (HttpWebRequest)WebRequest.Create(sec_req);
new_request.Credentials = new NetworkCredential(username,password);
new_request.Method = "POST";
new_request.ContentType = "application/atom+xml";

I would now like to send an atom entry element which requires:

<title type="text"> // I am going to have a title ex: "EXAMPLE TITLE"
<link href="link_url"/> // I will provide a url such as example.com
<content type="html"> // keep this as "html"

I think I am supposed to use string builder and send this as a header or something along those lines but I am not quite sure how it works, and what syntax to use. (I am creating a new bookmark using an API). Correct me if i'm wrong, when I send the header(in a string) to the service, if it goes through, then my bookmark will be created?

PLEASE HELP!!! THANKS IN ADVANCE!!!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 03:47PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month