locked
Web Service With Parameters RRS feed

All replies

  • User-1516073966 posted

    Hi 

    Try to use the POST instead of GET. 

    Refer the link below

    https://www.c-sharpcorner.com/blogs/web-api-with-post-method1

    Thanks,

    Chandra

    Thursday, March 29, 2018 3:44 PM
  • User-757283477 posted

    Hi Chandra,

    Thanks for your reply. 

    That link does not show me how to present a URL for external people to use and pass values into the service. It shows me how to consume the service via code.

    Regards,

    Loftty

    Thursday, March 29, 2018 3:57 PM
  • User-757283477 posted
    Any help anyone?
    Saturday, March 31, 2018 5:58 AM
  • User475983607 posted

    Any help anyone?

    It is up to the client to send data to the service.  See the Web API documentation to learn Web API.

    https://www.asp.net/web-api

    Can you explain at a high level the problem you are trying to solve?

    Saturday, March 31, 2018 11:39 AM
  • User-757283477 posted

    Hi Mgebhard,

    I have been asked to present a URL that can accept parameters. The parameters will be used to pass information that I can then populate into a database.

    Hope that makes sense :)

    Regards,

    Loftty

    Saturday, March 31, 2018 5:26 PM
  • User475983607 posted

    Hi Mgebhard,

    I have been asked to present a URL that can accept parameters. The parameters will be used to pass information that I can then populate into a database.

    Hope that makes sense :)

    Regards,

    Loftty

    Web site use HTTP GET and POST to submit data to a URL.  This is a standard and well known concept.  If this concept is new to you, set aside some time to learn HTTP basics. 

    https://www.w3schools.com/tags/ref_httpmethods.asp

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP

    The links in the previous posts explain how use Web API as a URL endpoint to accept data from clients.  

    Saturday, March 31, 2018 5:55 PM
  • User-757283477 posted

    Hi Mgebhard,

    Again, thanks for your response.

    I have my web service using GET, POST, PUT, which is fine. The issue I am having (and maybe I have used the wrong approach) is, I want to be able to simply type the URL for POST into a web browser, without making the customer have to write any code.

    Thanks again,

    Loftty

    Monday, April 2, 2018 10:39 AM
  • User475983607 posted

    loftty

    I have my web service using GET, POST, PUT, which is fine. The issue I am having (and maybe I have used the wrong approach) is, I want to be able to simply type the URL for POST into a web browser, without making the customer have to write any code.

    Of course that is not going to work because entering a URL in the browser address bar causes an HTTP GET not POST.  A POST requires an HTML web form. 

    These basic concepts are explained in the posted links. 

    Monday, April 2, 2018 12:31 PM
  • User-757283477 posted
    So the approach for what I want to achieve sounds incorrect. What would you suggest is the best approach?

    Regards,

    Loftty
    Monday, April 2, 2018 4:10 PM
  • User283571144 posted

    Hi loftty,

    The most easily for custom to pass the parameter to web api is using get method.

    The user could directly set the parameter in the url.

    If you want to use put or post method, you need create a request in codes and read the data into request body.

    If you just want your customer could easily pass parameters, I suggest you could choose get.

    Best Regards,

    Brando

    Thursday, April 12, 2018 8:00 AM