What is the best way to pass a set of parameters to a website?











up vote
0
down vote

favorite












I need to pass several parameters to a website (MVC web app built in VS2017) that in turn will be constructing a PDF that is returned to the viewer.



Something like this:
http://mywebsite.com?strAssetID=E2BEB600&strUserID=59&strGIU=1



I've been told that this is only possible with an API (i.e. REST API)



So does the web app need to be a REST API?
i.e. it can't be a simple hello world website?



Is there a better way to pass the parameters?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I need to pass several parameters to a website (MVC web app built in VS2017) that in turn will be constructing a PDF that is returned to the viewer.



    Something like this:
    http://mywebsite.com?strAssetID=E2BEB600&strUserID=59&strGIU=1



    I've been told that this is only possible with an API (i.e. REST API)



    So does the web app need to be a REST API?
    i.e. it can't be a simple hello world website?



    Is there a better way to pass the parameters?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to pass several parameters to a website (MVC web app built in VS2017) that in turn will be constructing a PDF that is returned to the viewer.



      Something like this:
      http://mywebsite.com?strAssetID=E2BEB600&strUserID=59&strGIU=1



      I've been told that this is only possible with an API (i.e. REST API)



      So does the web app need to be a REST API?
      i.e. it can't be a simple hello world website?



      Is there a better way to pass the parameters?










      share|improve this question













      I need to pass several parameters to a website (MVC web app built in VS2017) that in turn will be constructing a PDF that is returned to the viewer.



      Something like this:
      http://mywebsite.com?strAssetID=E2BEB600&strUserID=59&strGIU=1



      I've been told that this is only possible with an API (i.e. REST API)



      So does the web app need to be a REST API?
      i.e. it can't be a simple hello world website?



      Is there a better way to pass the parameters?







      asp.net api web-services parameters






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 at 16:04









      RGI

      8939




      8939
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          If you already have an MVC Web App then it should be relatively easy to add an Endpoint to it (e.g. /api/pdf/get?<your params>) that does this. MVC has great support for API responses, see e.g. How to return a PDF from a Web API application



          And unless you need hundreds of parameters, specifying the parameters in the URL as you did is the recommended approach.



          I wouldn't know why you would consider a "hello world website" (or even what you mean by that...) if you already have a full-blown MVC Web App.






          share|improve this answer





















          • Thanks for the reply. Our web-dev who has just taken over the app says it is currently a web service (SOAP) and we're considering changing to a REST API so we don't need to construct a SOAP message (because three different systems a) a web app b) Excel VBA and c) MSSQL need to be able to run it. It would be much easier in SQL to construct a URL (and the same for Excel VBA)
            – RGI
            Nov 19 at 16:37












          • Just to add a little bit more detail: The web front end and Excel must return the PDF to the user. MSSQL just needs to have it dropped into a folder on the server where it can be accessed.
            – RGI
            Nov 19 at 19:18











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378522%2fwhat-is-the-best-way-to-pass-a-set-of-parameters-to-a-website%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          If you already have an MVC Web App then it should be relatively easy to add an Endpoint to it (e.g. /api/pdf/get?<your params>) that does this. MVC has great support for API responses, see e.g. How to return a PDF from a Web API application



          And unless you need hundreds of parameters, specifying the parameters in the URL as you did is the recommended approach.



          I wouldn't know why you would consider a "hello world website" (or even what you mean by that...) if you already have a full-blown MVC Web App.






          share|improve this answer





















          • Thanks for the reply. Our web-dev who has just taken over the app says it is currently a web service (SOAP) and we're considering changing to a REST API so we don't need to construct a SOAP message (because three different systems a) a web app b) Excel VBA and c) MSSQL need to be able to run it. It would be much easier in SQL to construct a URL (and the same for Excel VBA)
            – RGI
            Nov 19 at 16:37












          • Just to add a little bit more detail: The web front end and Excel must return the PDF to the user. MSSQL just needs to have it dropped into a folder on the server where it can be accessed.
            – RGI
            Nov 19 at 19:18















          up vote
          1
          down vote













          If you already have an MVC Web App then it should be relatively easy to add an Endpoint to it (e.g. /api/pdf/get?<your params>) that does this. MVC has great support for API responses, see e.g. How to return a PDF from a Web API application



          And unless you need hundreds of parameters, specifying the parameters in the URL as you did is the recommended approach.



          I wouldn't know why you would consider a "hello world website" (or even what you mean by that...) if you already have a full-blown MVC Web App.






          share|improve this answer





















          • Thanks for the reply. Our web-dev who has just taken over the app says it is currently a web service (SOAP) and we're considering changing to a REST API so we don't need to construct a SOAP message (because three different systems a) a web app b) Excel VBA and c) MSSQL need to be able to run it. It would be much easier in SQL to construct a URL (and the same for Excel VBA)
            – RGI
            Nov 19 at 16:37












          • Just to add a little bit more detail: The web front end and Excel must return the PDF to the user. MSSQL just needs to have it dropped into a folder on the server where it can be accessed.
            – RGI
            Nov 19 at 19:18













          up vote
          1
          down vote










          up vote
          1
          down vote









          If you already have an MVC Web App then it should be relatively easy to add an Endpoint to it (e.g. /api/pdf/get?<your params>) that does this. MVC has great support for API responses, see e.g. How to return a PDF from a Web API application



          And unless you need hundreds of parameters, specifying the parameters in the URL as you did is the recommended approach.



          I wouldn't know why you would consider a "hello world website" (or even what you mean by that...) if you already have a full-blown MVC Web App.






          share|improve this answer












          If you already have an MVC Web App then it should be relatively easy to add an Endpoint to it (e.g. /api/pdf/get?<your params>) that does this. MVC has great support for API responses, see e.g. How to return a PDF from a Web API application



          And unless you need hundreds of parameters, specifying the parameters in the URL as you did is the recommended approach.



          I wouldn't know why you would consider a "hello world website" (or even what you mean by that...) if you already have a full-blown MVC Web App.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 19 at 16:12









          Peter B

          12.4k51941




          12.4k51941












          • Thanks for the reply. Our web-dev who has just taken over the app says it is currently a web service (SOAP) and we're considering changing to a REST API so we don't need to construct a SOAP message (because three different systems a) a web app b) Excel VBA and c) MSSQL need to be able to run it. It would be much easier in SQL to construct a URL (and the same for Excel VBA)
            – RGI
            Nov 19 at 16:37












          • Just to add a little bit more detail: The web front end and Excel must return the PDF to the user. MSSQL just needs to have it dropped into a folder on the server where it can be accessed.
            – RGI
            Nov 19 at 19:18


















          • Thanks for the reply. Our web-dev who has just taken over the app says it is currently a web service (SOAP) and we're considering changing to a REST API so we don't need to construct a SOAP message (because three different systems a) a web app b) Excel VBA and c) MSSQL need to be able to run it. It would be much easier in SQL to construct a URL (and the same for Excel VBA)
            – RGI
            Nov 19 at 16:37












          • Just to add a little bit more detail: The web front end and Excel must return the PDF to the user. MSSQL just needs to have it dropped into a folder on the server where it can be accessed.
            – RGI
            Nov 19 at 19:18
















          Thanks for the reply. Our web-dev who has just taken over the app says it is currently a web service (SOAP) and we're considering changing to a REST API so we don't need to construct a SOAP message (because three different systems a) a web app b) Excel VBA and c) MSSQL need to be able to run it. It would be much easier in SQL to construct a URL (and the same for Excel VBA)
          – RGI
          Nov 19 at 16:37






          Thanks for the reply. Our web-dev who has just taken over the app says it is currently a web service (SOAP) and we're considering changing to a REST API so we don't need to construct a SOAP message (because three different systems a) a web app b) Excel VBA and c) MSSQL need to be able to run it. It would be much easier in SQL to construct a URL (and the same for Excel VBA)
          – RGI
          Nov 19 at 16:37














          Just to add a little bit more detail: The web front end and Excel must return the PDF to the user. MSSQL just needs to have it dropped into a folder on the server where it can be accessed.
          – RGI
          Nov 19 at 19:18




          Just to add a little bit more detail: The web front end and Excel must return the PDF to the user. MSSQL just needs to have it dropped into a folder on the server where it can be accessed.
          – RGI
          Nov 19 at 19:18


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378522%2fwhat-is-the-best-way-to-pass-a-set-of-parameters-to-a-website%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          TypeError: fit_transform() missing 1 required positional argument: 'X'