cjyoung / MouseBitesWPF

WPF version of MouseBites
5 stars 1 forks source link

Stopped working? #15

Closed otictac1 closed 7 years ago

otictac1 commented 8 years ago

I wonder if the authentication needed to post requests to the site has changed because it seems as though this has stopped working? Everything returns with a:

The remote server returned an error: (400) Bad Request.

Error. Any thoughts on what might be causing that?

cjyoung commented 7 years ago

updated the code - looks like the search url needed a trailing '/' - so the data was posted to a page that returned a 302 (moved), and then the second request wasn't posting the data. Fixing the url seems to have resolved the 400 error

otictac1 commented 7 years ago

YES! Great find! I appreciate you fixing this so much. You are truly a lifesaver my friend.

otictac1 commented 7 years ago

I seriously cannot tell you how much I appreciate this.

You don't have to respond to this, but how did you debug this other than being a certified genius? What tipped you off to the slash being the missing thing that broke it?

cjyoung commented 7 years ago

I think I got lucky with this one. Typically, as a first step, I fire up Fiddler to look at the requests to see if the URLs or authentication flow has changed again - and that's where I saw that the request was being redirected with a 302 status.

When I looked at the payloads of the first request and then the one to the redirected page, I noticed that the criteria was missing from the second request. Looking at the URL that the 302 was redirecting me to, I noticed the only difference was the trailing slash - so I crossed my fingers, added the slash to the URL, and voilà!

I had actually sat down thinking this would be a good night to try and finally clean up and refactor the code a little - but I guess that'll have to wait for another day :)

By the way, I added another update so that if a search gets an error like that again, it'll report it under the "no availability column" instead of the false positive it was showing previously.

Here are the two requests as viewed in Fiddler: image

image

otictac1 commented 7 years ago

Thanks so much for that man. That really helped me understand your process of how you work through a problem like that.

Yours is the only project I've really dealt with on GitHub and I hope that every person is as helpful as you are. You really give the GitHub and programming community at large a good name.