curl - 使用PAW-App进行身份验证

时间:2016-03-10 15:07:33

标签: api rest curl paw-app

使用curl使用-u用户名连接到API:api-key --DIGEST正常工作。但是如何使用像PAW-App这样的API客户端进行测试呢?

1 个答案:

答案 0 :(得分:2)

对于大规模的延误表示歉意。这是Paw的Digest auth extension。您必须先安装它。

然后,插入新标头 public EnumDeclarationSyntax GenerateEnum() { var loanPurpose = new[] { "Business Launching", "HomePurchase", "HomeImprovement" }; var enumDescriptions = new[] { "Launch a new business", "Buy a home", "Make home improvements" }; var i = 0; var members = new List<EnumMemberDeclarationSyntax>(); foreach (var item in loanPurpose) { var attribute = SyntaxFactory.Attribute( SyntaxFactory.IdentifierName("Description")); var attributeArgument = SyntaxFactory.AttributeArgument( SyntaxFactory.LiteralExpression( SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(enumDescriptions[i ]))); attribute = attribute.WithArgumentList( SyntaxFactory.AttributeArgumentList( SyntaxFactory.SingletonSeparatedList(attributeArgument))); var attributes = SyntaxFactory.SingletonList( SyntaxFactory.AttributeList(SyntaxFactory .SingletonSeparatedList(attribute))); var objectCreationExpression = SyntaxFactory.EqualsValueClause( SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(i))); var member = SyntaxFactory.EnumMemberDeclaration(attributes, SyntaxFactory.Identifier(item), objectCreationExpression); members.Add(member); i++; } var declaration = SyntaxFactory.EnumDeclaration (new SyntaxList<AttributeListSyntax>(), baseList: null, identifier: SyntaxFactory.Identifier("LoanPurpose"), modifiers: SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)), members: SyntaxFactory.SeparatedList(members) ); return declaration; } 并右键单击值字段,然后选择Extensions&gt; Digest Auth:

Use HTTP Digest auth in Paw

然后,您应该可以编辑它,并设置您的凭据:

Set your credentials for HTTP Digest auth in Paw

您有关于Paw中Digest Auth的完整帮助主题:https://luckymarmot.com/paw/doc/auth/digest-auth