简体   繁体   English

WCF 4.0宁静的URl

[英]WCF 4.0 Restful URl

How can i be able to have the apikey on a wcf 4.0 restful service based on the ron jacobs tutorial to be in the following format 我如何基于ron jacobs教程在wcf 4.0 restful服务上具有apikey,格式如下

Example /customer/{apikey}/{other or no parameter}

Currently am only able to achieve the following /customer?apikey=8484734739-43948&parm2=ui

Warning: I don't do Jquery, I copied this off some random web site and changed it a bit. 警告:我不使用Jquery,而是从一些随机网站上复制了此代码,然后对其进行了一些更改。

jQuery.ajaxSetup({
    'beforeSend': function(xhr) {xhr.setRequestHeader("Authorization", "myapikey 8484734739-43948")}
})

Simply for reference: 仅供参考:

To append the api key to all requests, use the following code: 要将api密钥附加到所有请求,请使用以下代码:

jQuery.ajaxSetup({
  data: {
    apiKey: '8484734739-43948'
    ,parm2: 'ui'
  }
});

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

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