This post is by a banned member (_treva) - Unhide
OP 10 July, 2021 - 04:23 AM
(This post was last modified: 14 July, 2022 - 07:39 PM by _treva. Edited 2 times in total.)
Reply
This post is by a banned member (FIB01nacci) - Unhide
10 July, 2021 - 04:24 AM
(This post was last modified: 10 July, 2021 - 04:25 AM by FIB01nacci. Edited 1 time in total.)
Reply
you need to capture an updated official request, and copy the headers. and fill with the info you need.
This post is by a banned member (_treva) - Unhide
OP 10 July, 2021 - 04:29 AM
Reply
Sorry it's an authorization bearer token(don't know if that makes a difference), do I need to login every time to capture the new token before sending a request to that website?
This post is by a banned member (FIB01nacci) - Unhide
10 July, 2021 - 04:33 AM
(This post was last modified: 10 July, 2021 - 04:34 AM by FIB01nacci.)
Reply
(10 July, 2021 - 04:29 AM)_treva Wrote: Show MoreSorry it's an authorization bearer token(don't know if that makes a difference), do I need to login every time to capture the new token before sending a request to that website?
Yes, or you have to interact with the api, do you use postman?
token bearer is generated per transaction or session, have a life span
This post is by a banned member (_treva) - Unhide
OP 10 July, 2021 - 04:34 AM
(This post was last modified: 10 July, 2021 - 04:37 AM by _treva. Edited 1 time in total.)
Reply
(10 July, 2021 - 04:33 AM)FIB01nacci Wrote: Show More (10 July, 2021 - 04:29 AM)_treva Wrote: Show MoreSorry it's an authorization bearer token(don't know if that makes a difference), do I need to login every time to capture the new token before sending a request to that website?
Yes, or you have to interact with the api, do you use postman?
I was just sending a simple get httpwebrequest, with the auth attached in the header that i got from the login but didn't reveal any data, haven't heard of postman
This post is by a banned member (FIB01nacci) - Unhide
10 July, 2021 - 04:38 AM
Reply
(10 July, 2021 - 04:34 AM)_treva Wrote: Show More (10 July, 2021 - 04:33 AM)FIB01nacci Wrote: Show More (10 July, 2021 - 04:29 AM)_treva Wrote: Show MoreSorry it's an authorization bearer token(don't know if that makes a difference), do I need to login every time to capture the new token before sending a request to that website?
Yes, or you have to interact with the api, do you use postman?
I was just sending a simple get httpwebrequest, haven't heard of postman
in postman you can "copy curl" that transaction from your explorer (chrome, firefox) or use fiddler or any https sniffer if device and you'll see all headers and token, maybe cookie involved, read postman documentation.
This post is by a banned member (_treva) - Unhide
OP 10 July, 2021 - 04:45 AM
Reply
(10 July, 2021 - 04:38 AM)FIB01nacci Wrote: Show More (10 July, 2021 - 04:34 AM)_treva Wrote: Show More (10 July, 2021 - 04:33 AM)FIB01nacci Wrote: Show MoreYes, or you have to interact with the api, do you use postman?
I was just sending a simple get httpwebrequest, haven't heard of postman
in postman you can "copy curl" that transaction from your explorer (chrome, firefox) or use fiddler or any https sniffer if device and you'll see all headers and token, maybe cookie involved, read postman documentation.
I've got the bearer token manually from login with developer tools
This is the code I've tried have so far:
Code:
Dim request As HttpWebRequest = HttpWebRequest.Create("https://www.hellofresh.co.nz/gw/vouchers/" & _coupon & "?country=NZ&locale=en-NZ")
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
request.Headers.Add(HttpRequestHeader.Authorization, "Bearer " & _bearer)
Dim response As HttpWebResponse = request.GetResponse
Dim responsestream As New StreamReader(response.GetResponseStream)
Dim text As String = responsestream.ReadToEnd
Dim data = text
responsestream.Close()
request.Abort()
response.Close()
Console.WriteLine(data)
Console.Read()
but keep getting 403 forbidden
This post is by a banned member (FIB01nacci) - Unhide
10 July, 2021 - 05:13 AM
Reply
(10 July, 2021 - 04:45 AM)_treva Wrote: Show More (10 July, 2021 - 04:38 AM)FIB01nacci Wrote: Show More (10 July, 2021 - 04:34 AM)_treva Wrote: Show Morebut keep getting 403 forbidden
ok, the process is the same any site, any url, so i will show you with some random url.
(download postman Postman url is free up 3 members, just choose the first option. It is multiplatform.)
now copy curl like this from network dev tab
it produces as result something like this:
Quote:curl 'https://global.edge.bamgrid.com/paywall?' \
-H 'authority: global.edge.bamgrid.com' \
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"' \
-H 'x-bamsdk-platform: windows' \
-H 'x-bams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QiOnRydWUsImNvdW50cnlfc2V0dGluZ3MiOnsiY29kZSI6IlBBIiwidGltZXpvbmUiOnsibmFt6666IkFtZXJpY2EvUGFuYW1hIiwidXRjX29mZnNldCI6Ii0wNTowMCJ9LCJyYXRpbmdfc3lzdGVtcyI6WyJjdXN0b206ZGlzbmV5cGx1czpsYXRhbSJdfSwiZXhwZXJpbWVudHMiOnsid3BueC1EaXNuZXktSldFLWFjY291bnQtYWNjZXNzLXRva2VucyI6eyJ2YXJpYW50X2lkIjoiY29udHJvbCIsInZlcnNpb24iOjF9LCJ3cG54LXZzZl9zYXZlIjp7InZhcmlhbnRfaWQiOiJjZG5GYWxsYmFjayIsInZlcnNpb24iOjF9fSwicHJlZmVycmVkX21hdHVyaXR5X3JhdGluZyI6eyJyYXRpbmdfc3lzdGVtIjoiRGlzbmV5UGx1c0xBVEFNIiwiaW1wbGllZF9tYXR1cml0eV9yYXRpbmciOjE0OTksInByb2ZpbGVfaGFzX21hdHVyaXR5X3Jh666uZyI6dHJ1ZX0sImlkZW50aXR5Ijp7ImlkIjoiYWQ3NGZjYmEtMzNmYS00MGI5LWFiMmMtNDRmZjU4OGY1ZmQ2In19fQ.Rl3ApmyoprCBlv4owcgh0D04z8ohR0MffGClAtV47sSLJxFTCfo7kXy8vCnH1X2XfypZvKtlh8VUQLuXvbs8BQ' \
-H 'content-type: application/json; charset=utf-8' \
-H 'x-bamsdk-version: 8.0' \
-H 'accept: application/vnd.paywall-service+json; version=4' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' \
-H 'x-dss-edge-accept: vnd.dss.edge+json; version=2' \
-H 'origin: https://www.disneyplus.com' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://www.disneyplus.com/' \
-H 'accept-language: en-US,en;q=0.9,es;q=0.8,es-419;q=0.7,es-MX;q=0.6' \
--compressed
That curl, helps you to imitate the request, just like the original one does.
First, test the the one you just copy, to know if it works.
like this
and paste the curl in raw text
Continue
and now just press send.
As i told you read postman documentation for more help.
|