0

I would like to request a website which including my origin source:

i.e.

Host: https://webwebweb.com
Origin: https://somewebsite.com

I can request by running something like:

import requests
URL = 'someurl.com'
data =  requests.get(URL)

So which parameter I can add my origin then?

martineau
  • 119,623
  • 25
  • 170
  • 301
Jack Leo
  • 29
  • 5

1 Answers1

2

Origin is a header, so you can add like so :

requests.get(
    URL,
    headers={'Origin': ORIGIN}
)

The docs for request from request and http headers

Taek
  • 1,004
  • 7
  • 20