Post to an external url

Asked

Viewed 463 times

0

They put me on a project that was done in ASP. NET MVC 2 and need to be done the integration with Itaú Shopline, I downloaded the dll from Itaú, I did all the encryption procedures, I can generate the data, but when sending to the external URL the post returns to the server of the site and not to the url of Itaú, which makes perfect sense, so that’s where my doubt comes in.

How do I post to an external url and submit the information I need?

Follows the code that is given as an example in the Itaú documentation:

    <FORM ACTION=”https://shopline.itau.com.br/shopline/shopline.aspx”method=”post”
name=”form1” target=”SHOPLINE”>
     <INPUT type=”hidden”name=”DC”value=”<%= dados %>”>
<br>
     <INPUT type=”submit”name=”Shopline”value=”Itaú Shopline”>
</form>

Hugs!

  • Do you want to post from your controller? Try using the class Webrequest,

  • So, from what I understand, it’s like in the e-commerces that exist around, from a button on the page is made the call to an external url and in this way you make the call on the client side. From what I understand the documentation of Itaú

  • At a glance in this answer, has a demonstration of how to do POST using ajax

1 answer

0


Hello, I don’t know if this is what you’re looking for, but it might help.

OF:

<INPUT type=”submit”name=”Shopline”value=”Itaú Shopline”>

To:

<input type="button" name="Shopline" id="Shopline" value"Itau Shopline">

Then on JS with Jquery

$("#Shopline").click(function(){
$.post(
     "Sua URL", 
      function(){
          //trata retorno
      })
})

See this link: https://api.jquery.com/jquery.post/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.