Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

want to be able to send requests from the client using python code

$
0
0

I have a website that I want to automate and send requests from it. The final goal is to give the ability to the user that already was logged in, and has his session-id to send the requests from a React native app.

I have python code that uses the requests module to make requests to site the external server. I need these requests to be made from the client. However, I am not able to transform all this code to js/ts because there is a part that uses HttpOnly cookies in the process of authentication that can only be accessed on the server-side.

The main goal of the requests made by python is to authenticate the user and give his sid a number that can be received only once(That is how the server was implemented, I have absolutely no control on that). My goal is eventually to get this sid and then I will be able to send requests from the client with that sid. I also have to mention that sending the requests has to be done from the client(to send the requests not from the same ip every time.

My question is as following: what is the best way to receive that sid?

  1. Is it to run the python code as a service/subprocess in the native device? if so, how? maybe even embed the python code into the client side code, even though it sounds not so right..

  2. Is it giving the user the option to log in by himself via displaying a web page of that site with the login, and then somehow scrape the web page and get that sid from the headers of one of responses? how can that be done if so?

Maybe there are another solutions to the problem that I haven't mentioned.


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>