0

I been stuck on this for past few hours. Can't figure this out. I tested this out on postman and it works fine. But in python, I kept getting 405 requests.

Raw API request

OPTIONS /sessions HTTP/1.1
Host: elb.deposit.shopifycs.com
Access-Control-Request-Method: POST
Origin: https://checkout.shopifycs.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Access-Control-Request-Headers: content-type
Accept: */*
Referer:
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

url = 'https://elb.deposit.shopifycs.com/'
resp = session.options(url, headers = Headers)
print resp.status_code, ' status'
6
  • The server id returning a HTTP Error 405 Method not allowed your code works against httpbin.org/get. Allow get on your server Commented Dec 14, 2016 at 19:30
  • Sorry. i am confuse. Website is blocking my get/options requests? It is not my server. Commented Dec 14, 2016 at 19:36
  • Sorry the URL elb.deposit.shopifycs.com/sessions works as you use in postman Commented Dec 14, 2016 at 19:43
  • Yes, I tried with postman and it worked fine. Any idea why my code is not working? Commented Dec 14, 2016 at 19:49
  • your using a different URL /sessions in postman Commented Dec 14, 2016 at 19:51

1 Answer 1

1

Just for the record the answer was to use the correct URL.

url = 'https://elb.deposit.shopifycs.com/sessions'

(I hope posting an answer will prevent other people from spending too much time looking at it)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.