Get url from the address of another url

0

I am trying to use the free market api, and I am having a million problems, since it is the first time that I communicate with apis.

The free market question gives you a sdk, where you have meli classes.

Meli m = new Meli (8031175177076953L, "GwOHbDRJaYhnkFTM52GBzyQPVE6l2L4j"); In this line we create the instance of meli with a valid user

String redirectUrl = m.getAuthUrl (" link ", Meli.AuthUrls.MLA); This gives us a url, which when accessing directs us to another where a code is found. We received: link

redirects us: link

What I want is to extract from that url "code = TG-5b0cb8cae4b0618b5d5dcb52-323536207"

But for now, to get it I am accessing a browser, I paste the first url and it directs me to the new one (where the code is located). I need help to generate the redirect from java code and get the url without having to open the browser and paste the first i Url.

    
asked by Fernando Godoy 29.05.2018 в 04:21
source

0 answers