简体   繁体   English

与C#开发人员就API中的错误进行沟通的最佳方法是什么?

[英]Whats the best way to communicate with C# developers about bugs in their API?

I'm testing an API which is written by C# developers. 我正在测试由C#开发人员编写的API。 I am a Perl developer. 我是Perl开发人员。 So I would like a language agnostic way to send them bug reports. 因此,我想使用一种与语言无关的方式向他们发送错误报告。 For GET requests this is trivial (unless headers are involved). 对于GET请求,这很简单(除非涉及标头)。 But for POSTs its not. 但是对于POST则不是。

Many sites that document APIs these days use curl commands in their documentation in order to provide language agnostic examples. 如今,许多记录API的站点在其文档中都使用curl命令,以提供与语言无关的示例。 For example Stripe . 例如Stripe

In the Unix or OSX world I would send them a curl command and say when you run this the response is broken in some way. 在Unix或OSX世界中,我会向他们发送curl命令,并说当您运行此命令时,响应会以某种方式中断。 But curl is not native to Windows (although it can be installed and run on Windows). 但是curl不是Windows固有的(尽管它可以在Windows上安装并运行)。 Are C# devs aware of curl? C#开发人员是否了解curl? Do they use curl? 他们会卷曲吗? I assume they are not thrilled to be pushed onto the command line, but I can't think of a better way to talk about these things. 我认为将它们推送到命令行并不感到兴奋,但是我想不出一种更好的方式来谈论这些事情。 Any suggestions? 有什么建议么?

But for POSTs its not. 但是对于POST则不是。

Why? 为什么? At the end GET and POST are HTTP. 最后,GET和POST是HTTP。 Send over the header that is sent, not your API call. 通过发送的标头发送,而不是通过API调用发送。

Are C# devs aware of curl? C#开发人员是否了解curl?

I am not. 我不是。 I would not accept such a bug report. 我不接受此类错误报告。 But I would gladly accept the HTTP payload as a dump. 但是我很乐意接受HTTP有效负载作为转储。

I assume they are not thrilled to be pushed onto the command line, 我认为将它们推送到命令行并不激动,

I would not assume curl being pushed on the command line. 我不认为在命令行上会推卷曲。 I would assume it being pushed to a tool I don't like intalling. 我认为它被推到了我不喜欢安装的工具上。 I use command line all the time - heck, I maintain a software that is mostly used by some people thorugh the command line. 我一直都在使用命令行-哎呀,我维护着一些大多数人通过命令行使用的软件。

Just command line in windows is PowerShell. Windows中仅命令行是PowerShell。

Do not use curl. 不要使用卷曲。 It's far to Unix-y for most C# programmers. 对于大多数C#程序员而言,它离Unix-y还很远。 As a rule it will require some kind of command line escaping convention, and that's not portable either. 通常,它将需要某种命令行转义约定,并且这也不是可移植的。 It will not be welcome. 这将不受欢迎。

I see nothing wrong with providing the exact HTTP call/request sequence in your bug report as plain text. 在错误报告中以纯文本格式提供确切的HTTP调用/请求顺序,我没有发现任何问题。

  1. Anyone can read it in a totally language-agnostic way. 任何人都可以以完全与语言无关的方式阅读它。
  2. It's relatively easy to cut and paste fragments to try it out. 剪切和粘贴片段进行试用相对容易。
  3. If anyone is interested enough in your bug reports, it's easy enough to write a little tool to convert it into something C# can handle, or Powershell, or even curl. 如果有人对您的错误报告足够感兴趣,那么很容易编写一个小的工具将其转换为C#可以处理的东西,Powershell甚至是curl。

[As it happens I use C#, curl and even wget perfectly happily in Windows, but my answer stands.] [碰巧我在Windows中使用C#,curl甚至wget都非常开心,但是我的回答仍然成立。]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM