标签: endpoint

如何使用C#窗体创建一个简单的本地网页

我希望使用C#Windows窗体应用程序或C#控制台应用程序创建一个简单的网页.

运行该应用程序将开始在以下位置托管网页:

http://localhost:3070/somepage
Run Code Online (Sandbox Code Playgroud)

我在MSDN上读了一些关于使用端点的内容,但是自学成才,这对我来说没什么意义......

简而言之,该程序在运行时将在localhost:3070的网页上显示一些文本.

对于这样一个模糊的问题感到抱歉,但是我搜索一个体面的教程的时间并没有产生任何可以理解的结果......

谢谢你的时间!

c# hosting localhost endpoint

4
推荐指数
2
解决办法
8617
查看次数

为什么我需要一个没有端点的 USB 备用接口?

Atmel 为 USB 设备提供的示例代码有一个具有两种备用设置的接口。第一个没有端点,第二个有 6 个端点。这有什么原因吗 - 为什么不只为所有端点设置一个备用设置?

我在互联网上发现了一个模糊的帖子,暗示这可能与省电有关。有人有什么主意吗?

usb interface endpoint alternate

4
推荐指数
1
解决办法
1475
查看次数

保存推送订阅

我目前正在 Developers.google.com 上阅读有关推送通知的内容。

我已经得到了一个推送订阅对象。
但我不确定保存它的最佳方法。

这是来自谷歌的代码

function subscribeUserToPush() {
    return getSWRegistration().then(function(registration) {
        const subscribeOptions = {
            userVisibleOnly: true,
            applicationServerKey: urlBase64ToUint8Array('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
        };

        return registration.pushManager.subscribe(subscribeOptions);
    }).then(function(pushSubscription) {
        console.log('Received PushSubscription: ', JSON.stringify(pushSubscription));
        return pushSubscription;
    });
}
Run Code Online (Sandbox Code Playgroud)

我有一个数据库,其中有一个用户表,所以我应该在那里创建一个新列,并在那里存储字符串化的 JSON 订阅对象吗?

或者更好地为订阅创建一个新表?
例如这样的桌子?

用户 ID | 终点| p256dh | p256dh | 授权

一个用户可以有多个订阅吗?在这种情况下,我认为专用的订阅表是首选。

关于 VAPID 密钥,我应该像上面那样将公共权限放入代码中吗?然后将私人的存储在安全的地方?

谢谢。

javascript endpoint push-notification progressive-web-apps

4
推荐指数
1
解决办法
2055
查看次数

SendGrid 事件通知认证

我已经为 sendgrid 设置了一个端点来发送事件通知。但是,服务器设置了基本身份验证,并且事件不会通过,因为它们未经身份验证。如何通过 SendGrid 或白名单 SendGrid 对这些事件 webhook 进行身份验证?

endpoint webhooks sendgrid sendgrid-api-v3

4
推荐指数
1
解决办法
949
查看次数

在没有 Host/x-apigw-api-id 标头的情况下调用私有 API 网关

我有一个带有关联 VPC 终端节点的私有 API 网关阶段,并且我已经按照此处的说明进行操作:https: //aws.amazon.com/premiumsupport/knowledge-center/api-gateway-vpc-connections/ 了解如何连接从 VPC 内部访问我的 API。使用 Host/x-apigw-api-id 按预期工作,但我有一些第三方服务,我无法添加这些标头来使它们连接。

有没有办法在不使用 Host 或 x-apigw-api-id 标头的情况下连接到特定于端点的主机名?例如(当前)curl“ https://vpc-endpoint-specific-hostname/route/ ”-H'x-apigw-api-id:'(所需)curl“https://.vpc-endpoint-specific-hostname /route/”(注意没有标题)

我知道文档所说的内容,即使用两个标头 Host/x-apigw-api-id 中的一个,但我无法为我的某些服务添加这些标头。

api private endpoint vpc amazon-web-services

4
推荐指数
1
解决办法
4936
查看次数

将 POST 发送到自定义休息端点时 XSRF 检查失败

我有一个 ScriptRunner 片段,它显示一个表单对话框。这是代码:

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.transform.BaseScript

import javax.ws.rs.core.MediaType
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response

@BaseScript CustomEndpointDelegate delegate

showCloneEazyBIAccounts() { MultivaluedMap queryParams ->

def dialog =
    """<section role="dialog" id="sr-dialog" class="aui-layer aui-dialog2 aui-dialog2-medium" aria-hidden="true" data-aui-remove-on-hide="true">
        <header class="aui-dialog2-header">
            <h2 class="aui-dialog2-header-main">Clone EazyBI Accounts by Model</h2>
            <a class="aui-dialog2-header-close">
                <span class="aui-icon aui-icon-small aui-iconfont-close-dialog">Close</span>
            </a>
        </header>
        <div class="aui-dialog2-content">
            <form class="aui" action="/rest/scriptrunner/latest/custom/cloneJE2Cube" method="post">
                <div class="field-group">
                    <label for="accountNames">Account Names <span class="aui-icon icon-required"></span></label>
                    <input class="text medium-field" type="text"id="accountNames" name="accountNames" placeholder="Cubo 1, Cubo 2...">
                </div>
                <div class="field-group">
                    <label for="projectKeys">Project Keys <span class="aui-icon icon-required"></span></label> …
Run Code Online (Sandbox Code Playgroud)

html forms endpoint jira-plugin x-xsrf-token

4
推荐指数
1
解决办法
1万
查看次数

在从 net.tcp 协议连接到 WCF 的端点上侦听的问题

这个奇怪的错误是在发布这篇文章的前一天出现的。以前它工作正常,但现在不行了。

在重新启动系统的一个动作中,错误消失并能够访问应用程序。

再次重新启动系统后,错误开始出现而不知道根本原因。

启用的协议: net.tcp,http

我可以浏览以下链接

这是导致异常的以下代码段

objCheckUserLoginResponse = AuthenticationManagerClient.Check(objCheckUserLoginRequest, objCustomer);
Run Code Online (Sandbox Code Playgroud)

例外:

The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/TAServices/AuthenticationManager.svc' is unavailable for the protocol of the address. 
System.ServiceModel.EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/TAServices/AuthenticationManager.svc' is unavailable for the protocol of the address.

Server stack trace: 
   at System.ServiceModel.Channels.ConnectionUpgradeHelper.DecodeFramingFault(ClientFramingDecoder decoder, IConnection connection, Uri via, String contentType, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper& timeoutHelper, ClientFramingDecoder …
Run Code Online (Sandbox Code Playgroud)

asp.net iis wcf endpoint net.tcp

4
推荐指数
2
解决办法
2178
查看次数

登录操作后在 Guzzle HTTP 客户端中设置授权承载标头 - Laravel

我目前正在开发一个 Laravel 项目来向 API 发出请求。对端点的每个请求都需要标头中的令牌。

我创建了一个用于登录的函数,当登录成功时,我想在对端点的每个请求的标头中放置一个令牌。

我可以使用 Guzzle 做到这一点吗?

这是我的登录功能

public function login(Request $request)
{
    $client = new Client();
    $url = "http://localhost:8002/login";

    $request = $client->post($url, [
        'headers'=> ['Content-Type' => 'application/json'],
        'body' => json_encode([
            'email' => $request->email,
            'password' => $request->password,
        ])
    
    ]);

    $response = json_decode($request->getBody());
    $token = $response->result->token; //I have got the token
    

}
Run Code Online (Sandbox Code Playgroud)

api token endpoint laravel guzzle

4
推荐指数
1
解决办法
9836
查看次数

Quarkus 与 Swagger UI 申请全局授权

我已经使用@OpenAPIDefinition注释配置了 OpenAPI,以在 Swagger UI 上显示授权(按钮),但目前它没有功能,当我尝试进行身份验证时,它什么也不做(不执行任何请求)。

我想要实现的是通过 Swagger UI 上的授权按钮进行身份验证;然后提取令牌并将其作为授权标头传递到所有端点。

如何配置和利用授权功能,然后使其对所有端点全局可用?

我的应用程序使用带有 Bearer 方法的 HTTP 进行保护。

Swagger UI 身份验证的当前配置

@OpenAPIDefinition(
    info = @Info(
            title = "My API",
            version = "1.0.0"
    ),
    components = @Components(
            securitySchemes = {
                    @SecurityScheme(
                            securitySchemeName = "bearerAuth",
                            type = SecuritySchemeType.HTTP,
                            scheme = "bearer",
                            bearerFormat = "JWT"
                    ),
                    @SecurityScheme(
                            securitySchemeName = "basic",
                            type = SecuritySchemeType.HTTP,
                            scheme = "basic"
                    )
            }
    ),
    security = {
            @SecurityRequirement(name = "bearerAuth"),
            @SecurityRequirement(name = "basic")
    }
)
public class CustomApi extends …
Run Code Online (Sandbox Code Playgroud)

authentication endpoint swagger swagger-ui quarkus

4
推荐指数
1
解决办法
3862
查看次数

在 WooCommerce 中设置我的帐户自定义项目端点标题

我通过成功添加新端点来自定义我的 woocommerce 帐户页面。\n这个新端点的标题是“我的帐户”默认标题。我也想自定义标题。\n我尝试使用挂钩“woocommerce_endpoint_{endpoints}_title”,它在默认端点上完美工作,但它似乎不适用于自定义端点:

\n

我的自定义端点(不起作用):

\n
add_filter( \'woocommerce_endpoint_favoris_title\', \'change_my_account_favoris_title\', 10, 2 );\nfunction change_my_account_favoris_title( $title, $endpoint ) {\n    $title = __( "Tests", "woocommerce" );\n    return $title;\n}\n
Run Code Online (Sandbox Code Playgroud)\n

自定义端点

\n

默认端点示例工作:

\n
add_filter( \'woocommerce_endpoint_edit-account_title\', \'change_my_account_edit_title\', 10, 2 );\nfunction change_my_account_edit_title( $title, $endpoint ) {\n    $title = __( "Tests", "woocommerce" );\n    return $title;\n}\n
Run Code Online (Sandbox Code Playgroud)\n

默认端点

\n

目前找不到任何相关内容,\n感谢您的宝贵时间

\n
\n

编辑:

\n

我的 woocommerce 帐户部分的完整挂钩:

\n

1/ 创建端点:

\n
add_filter (\'woocommerce_account_menu_items\', \'custom_log_history_link\', 40);\nfunction custom_log_history_link($menu_links){\n    $menu_links = array_slice( $menu_links, 0, 5, true )\n        + array( \'favoris\' …
Run Code Online (Sandbox Code Playgroud)

php wordpress endpoint woocommerce hook-woocommerce

4
推荐指数
1
解决办法
1692
查看次数