Quantcast
Viewing latest article 15
Browse Latest Browse All 25503

Basic Auth Without Cookies using python requests by real_jon_mayer

Hi-

I'm trying to set up a private app to modify order_tags in certain scenarios, which involves using the dreaded "put" method (only dreaded because of https://ecommerce.shopify.com/c/api-announcements/t/shopify-now-prevents-http-basic-auth-post-requests-that-have-cookies-419417 )

I'm receiving the same error as the users there, but am struggling to get python requests package to do a request without cookies. 

My code looks like the following:

tags = 'Jon Mayer Official'
o_id = 12345
api_key = abcdefg
password = 12345
#the orderid/password changed for security reasons to the combination an idiot uses on their luggage

shop_url = "https://%s.myshopify.com/admin/orders/#{%s}.json" %(shop_name,o_id)
auth = api_key+":"+password

headers = {
    'Authorization': 'Basic {token}'.format(
        token=base64.b64encode(auth.encode()).decode('ascii'))
}

payload = {
  "order": {
    "id": o_id,
    "tags": tags
  }
}

How do I get this to run without cookies? As per the link above, whatever I'm doing seems to have cookies. 

Thanks,

Real Jon Mayer


Viewing latest article 15
Browse Latest Browse All 25503

Trending Articles



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