Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 2809

closed

by _treva - 10 July, 2021 - 04:23 AM
This post is by a banned member (_treva) - Unhide
_treva  
Supreme
93
Posts
18
Threads
5 Years of service
#1
(This post was last modified: 14 July, 2022 - 07:39 PM by _treva. Edited 2 times in total.)
closed
This post is by a banned member (FIB01nacci) - Unhide
This post is by a banned member (_treva) - Unhide
_treva  
Supreme
93
Posts
18
Threads
5 Years of service
#3
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
This post is by a banned member (_treva) - Unhide
_treva  
Supreme
93
Posts
18
Threads
5 Years of service
#5
(This post was last modified: 10 July, 2021 - 04:37 AM by _treva. Edited 1 time in total.)
(10 July, 2021 - 04:33 AM)FIB01nacci Wrote: Show More
(10 July, 2021 - 04:29 AM)_treva Wrote: Show More
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?

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
This post is by a banned member (_treva) - Unhide
_treva  
Supreme
93
Posts
18
Threads
5 Years of service
#7
(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 More
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.

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

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 4 Guest(s)