• This is Microsoft.
  • He returns Webhook success with a code 200 and plaintext 1.
  • He returns Webhook failure with a code 200 and a string tells its endpoint returned error 400.
  • the string didn’t tell what exactly the error.
  • Don’t be like Microsoft.

EDIT: Got a few details wrong since this happens a few months ago and this meme used to be on r/ProgrammerHumor. Also the proof:

You are viewing a single thread.
View all comments
62 points

It’s hard when you hit an endpoint that hits another endpoint, because technically the first request IS a 200. No right or wrong way as long as they are consistent and document it clearly imo

permalink
report
reply
51 points

Now here is the fun part: they do not have a API documentation; they only have a very generic guide on how to setup webhook API

permalink
report
parent
reply
36 points

Microsoft code docs are the literal worst

permalink
report
parent
reply
32 points

Lmao, Microsoft code docs are absolutely amazing compared to the undocumented bullshit I have to deal with at most companies that have rolled their own services.

permalink
report
parent
reply
16 points

Microsoft docs in general are the worst. Can’t tell you how many fucking dead links and straight up incorrect information I’ve come across on their official help articles

permalink
report
parent
reply
8 points

I see you’ve never dealt with chip vendors

permalink
report
parent
reply
7 points

I my experience you then send a different error code to help developers know that right away. Really if there is nothing the developer could do it should be a 500 server error. The server did in fact error.

If the developer should have done something different then translate it to an appropriate code, 400 bad request or something

permalink
report
parent
reply
2 points

X-Forwarded?

permalink
report
parent
reply
1 point

Can / should you use it for anything other than IPs?

permalink
report
parent
reply
4 points

Well, if its acting as a proxy, then the status code should be transmitted intact right?

permalink
report
parent
reply
2 points

In this case I like to return a 502.

permalink
report
parent
reply
1 point

Great time to implement a 7XX code: https://github.com/joho/7XX-rfc

739 might be a good one

permalink
report
parent
reply
1 point

Nice! I’m definitely going to implement 787 at work.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 6.4K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments