ElonMusk Posted April 27, 2022 Report Posted April 27, 2022 im using axios and get "Uncaught Error Error: Request failed with status code 403" can you take a look at the image below and tell me whats wrong i had alook at and everything looks to be correct any help would be apreciated Quote
Dr. McKay Posted April 27, 2022 Report Posted April 27, 2022 You're sending all the post parameters as cookies. Quote
ElonMusk Posted April 28, 2022 Author Report Posted April 28, 2022 21 hours ago, Dr. McKay said: You're sending all the post parameters as cookies. where do i put the parameters? do they go in the post body and also what about the headers should it just be the referer? Quote
Dr. McKay Posted April 28, 2022 Report Posted April 28, 2022 The post parameters go in the post body, yes. Referer should be the only extra header you need. Quote
ElonMusk Posted April 28, 2022 Author Report Posted April 28, 2022 1 hour ago, Dr. McKay said: The post parameters go in the post body, yes. Referer should be the only extra header you need. i made a request using postman just incase something was wrong with my code if i put a ? before the accept (https://steamcommunity.com/tradeoffer/tradeid/?accept) i get taken to a steam login page however if there is no ? then i get a 403 could there be a problem with the authentication? Quote
Dr. McKay Posted April 28, 2022 Report Posted April 28, 2022 That sounds like your cookies are invalid or expired. Quote
ElonMusk Posted May 16, 2022 Author Report Posted May 16, 2022 On 4/28/2022 at 9:37 PM, Dr. McKay said: That sounds like your cookies are invalid or expired. can you confirm im doing everything correct? i still get null the cookies go like this : steamlogin,steamloginsecure and session id are all from a instance where i sign in with steam user and console log the cookies i then pasted them into the postman request, the only extra header is the referrer . partner id is a 32 steam id of my trade partner, captcha remains empty and serverid is set to 1. is there something im doing wrong? the params page on post man adds stuff to the top of the link ex: steamcommunity.com/accept?param. sorry if im bothering you i just cant find alot about steam http request on the internet. Quote
Dr. McKay Posted May 17, 2022 Report Posted May 17, 2022 Cookies go in headers, not in the request body. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie Quote
ElonMusk Posted May 17, 2022 Author Report Posted May 17, 2022 12 hours ago, Dr. McKay said: Cookies go in headers, not in the request body. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie this is what i have right now yet i still get a 403 i guess you mean the steam login cookies go in the headers however ive tried the other way arround and even both but still no progress Quote
Dr. McKay Posted May 19, 2022 Report Posted May 19, 2022 Cookies go in the Cookie header. Check that MDN link I posted. Quote
ElonMusk Posted May 19, 2022 Author Report Posted May 19, 2022 (edited) axios.post("https://steamcommunity.com/tradeoffer/5188600819/accept",{ headers:{ "Referer":"https://steamcommunity.com/tradeoffer/5188600819/", "cookies":{"steamLoginSecure":"-----","steamMachineAuth-----":"------","steamLogin":"-----","sessionid":"-----",} }, form:{ "tradeofferid":5188600819, "partner"://partner id , "serverid":1, "captcha": "", } }) .then((res)=>{ console.log(res) }) //so i can see the request data after before it ends setTimeout(()=>{console.log("test")},100000); i come up with this and still get a 403 this is correct right? the cookies are in the cookie header Edited May 19, 2022 by ElonMusk unreadable lol had to convert to text Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.