草庐IT

non-RESTful

全部标签

c# - 如何在 .NET 中使用 Restful 服务?

关闭。这个问题需要更多focused.它目前不接受答案。想改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭6年前。Improvethisquestion使用.Net框架使用RESTful服务有哪些选择?WCF(使用WebChannelFactory)什么时候比HttpClient更可取?

C# 错误 : "An object reference is required for the non-static field, method, or property"

我有两个类,一个用于定义算法参数,另一个用于实现算法:1类(算法参数):usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceVM_Placement{publicstaticclassAlgorithmParameters{publicstaticintpop_size=100;publicstaticdoublecrossover_rate=0.7;publicstaticdoublemutation_rate=0.001;publicstaticintchrom

c# - MVC : The parameters dictionary contains a null entry for parameter 'k' of non-nullable type 'System.Int32'

我是MVC的新手。在我的应用程序中,我正在从Mydatabase中检索数据。但是当我运行我的应用程序时,它会显示这样的错误这是我的网址http://localhost:7317/Employee/DetailsData/4ExceptionDetails:System.ArgumentException:Theparametersdictionarycontainsanullentryforparameter'k'ofnon-nullabletype'System.Int32'formethod'System.Web.Mvc.ActionResultDetailsData(Int32)

API 风格 (三):RESTful & gRPC

RESTful VS  gRPC对比项RESTfulgRPC优点相对来说,REST更规范、标准、通用,无论哪种语言都支持HTTP协议,可以对接外部很多系统,只要满足HTTP调用即可。通常采用JSON作为数据通信格式,可读性强,开发调试都很方便。客户端与服务端之间松耦合,让变更更加方便。屏蔽网路细节,像调用本地方法一样,调用远程接口。通常采用ProtocolBuffers作为数据传输格式,这种格式数据传输效率高。基于HTTP/2协议标准,性能更高。缺点扩展性差:随着需求的变化,单个RESTful接口可能会变得越来越臃肿。性能相对于gRPC偏低。Protobuf数据格式可读性差。gRPC不支持浏览

c# - 为什么我会收到消息 "Invalid setup on a non-virtual (overridable in VB) member..."的异常?

我有一个单元测试,我必须模拟一个返回bool类型的非虚拟方法publicclassXmlCupboardAccess{publicboolIsDataEntityInXmlCupboard(stringdataId,outstringnameInCupboard,outstringrefTypeInCupboard,stringnameTemplate=null){returnIsDataEntityInXmlCupboard(_theDb,dataId,outnameInCupboard,outrefTypeInCupboard,nameTemplate);}}所以我有一个XmlCu

javascript - 错误 : [$compile:nonassign] Expression 'undefined' used with directive 'myFacebook' is non-assignable

我正在用angularjs编写一个指令并得到上面提到的错误。我正在使用一本书中的代码。.directive('myFacebook',[function(){return{link:function(scope,element,attributes){(function(d){varjs,id='facebook-jssdk',ref=d.getElementsByTagName('script')[0];if(d.getElementById(id)){return;}js=d.createElement('script');js.id=id;js.async=true;js.src

转到 1.12 模块 : local import in non-local import

我目前正在使用Go1.12模块并且对导入感到厌烦。我正在使用gin(网络微服务)和gorm(golangorm)制作rest-api。在golang模块中工作时一切仍然正常。但是在导入本地包时遇到问题目录树:go.mod:modulegithub.com/Aragami1408/go-gormgo1.12require(github.com/gin-gonic/ginv1.4.0github.com/jinzhu/gormv1.9.9github.com/lib/pqv1.1.1github.com/satori/go.uuidv1.2.0)db.go:packagedb//codeb

golang - 将枚举类型保存到 SQL 数据库 "panic: sql: converting Exec argument #1' s 类型 : non-Value type int returned from Value"

在我当前的go项目(~5KLOC)中,我使用sqlite3作为我的底层数据库层,我使用gorm作为我的ORM引擎。其中一个模型是一个Platform,其字段为PlatformType枚举类型。这是演示我的问题的代码片段。packagemainimport(_"github.com/jinzhu/gorm/dialects/sqlite""github.com/jinzhu/gorm""database/sql/driver""fmt")/****************************\ObjectLayer\****************************///Pla

function - 语法错误 : Non-declaration statement outside function body

makeEvenGenerator函数应该返回一个按顺序生成偶数的函数:packagemainimport"fmt"funcmakeEvenGenerator()func()uint{i:=uint(0)returnfunc()(retuint){ret=ii+=2return}}funcmain(){nextEven:=makeEvenGenerator()fmt.Println(nextEven())//0fmt.Println(nextEven())//2fmt.Println(nextEven())//4}当我运行它时,我得到错误syntaxerror:unexpectedfu

database - 带有外键的模型上的 restful api

TLDR;如何在buffalo框架中为具有外键(或一般的数据库关系)的模型创建RESTapi?我是go的绝对初学者,我正在尝试使用buffalo框架按照其官方网站上给出的以下示例编写RESTFul服务。我能够在没有数据库关系的模型上创建RESTfulapi。但是当我遇到模型有外键的情况时,我被卡住了。我无法在网上找到任何文档或引用资料。我对围棋的概念也很薄弱,你也可以在这些方面教我。型号:(引用:https://gobuffalo.io/en/docs/db/relations#exampletypeComposerstruct{IDuuid.UUID`json:"id"db:"id"