0

Sorry Repost a question like this post : What is the difference between HTTP and REST?

some people ask me to make receiver to response this ( Post Method ) Sender=6281322222&recipient=8000

they say to me like this : "you must make a HTTP Rest Service (Post Method)".

I'm not understand difference From HTTP and HTTP Rest Sevice

Can I create receiver like this (using web service)? Can I Call this code as HTTP Rest Service ?can I Reponse Post Method using this code? enter image description here

Community
  • 1
  • 1
Michael
  • 33
  • 5

1 Answers1

2

I think you need to do some research on what REST is. You are kind of on the right track with your code. I will try to explain REST to you because I have worked with it religiously this year...

Think of REST as just a "fancy word" meaning for two websites to communicate with one another. When a website/application supports REST, it means that you can send requests to it (either POST or GET) and it will return data. Data returned from a REST call is typically in a format like XML or JSON format (in fact, it's kind of the "standard" that it be returned in JSON format). REST almost never returns anything like plain text data, it is usually formatted as I just explained.

Your code, I'm not sure you are on the right track. If you were sending a request to a REST application, you would need to created a web request. In this web request, then change the header type to GET or POST depending on what the application supports. See here: https://msdn.microsoft.com/en-us/library/debx8sh9(v=vs.110).aspx

When you work with web request, it's just another fancy term for "web browser". Think of web request as a browser. You can read and parse all the data on a page and communicate with it as a web browser would. On the other hand, if someone asked you to write something that supports a REST request, you would write something that accepts variables in either POST or GET. Does that make more sense?

Edward B.
  • 437
  • 3
  • 10
  • Ehm, some people ask me to make http rest service ( post method ). And then I make web services to handles request (post method ) from client and response it with "string"... If I reponse with xml or json, can I call it as string? – Michael Nov 08 '15 at 10:56