rest

Sending JSON POST request in VBA

时光怂恿深爱的人放手 提交于 2021-02-08 03:40:41
问题 I have the following JSON POST sample code which I am trying to convert to VBA for Excel: POST /services/shipper/orders HTTP/1.1 Content-Type: application/json User-Agent: Mozilla 5.0 Host: qa.etowertech.com X-WallTech-Date: Tue, 06 Jan 2018 21:20:27 GMT Authorization: WallTech test5AdbzO5OEeOpvgAVXUFE0A:79db9e5OEeOpvgAVXUFWSD Here is the code I came up with: With JsonHTTP .Open "POST", "http://qa.towertech.com/services/shipper/orders", False .setRequestHeader "RequestName", "application/json

Sending JSON POST request in VBA

こ雲淡風輕ζ 提交于 2021-02-08 03:40:34
问题 I have the following JSON POST sample code which I am trying to convert to VBA for Excel: POST /services/shipper/orders HTTP/1.1 Content-Type: application/json User-Agent: Mozilla 5.0 Host: qa.etowertech.com X-WallTech-Date: Tue, 06 Jan 2018 21:20:27 GMT Authorization: WallTech test5AdbzO5OEeOpvgAVXUFE0A:79db9e5OEeOpvgAVXUFWSD Here is the code I came up with: With JsonHTTP .Open "POST", "http://qa.towertech.com/services/shipper/orders", False .setRequestHeader "RequestName", "application/json

Respond 200 with error or the response code as the error code

删除回忆录丶 提交于 2021-02-08 02:15:30
问题 So, being a developer I have a very basic question, in a REST standard we have 100's of error code for specific reason like: 4xx if resource related 5xx if exception occurred in server and many more. Now when it comes to the implementation there are situations when we return 404 directly as the response status code with the error message in the response body . With this approach there is a thing that I think a bit confusing, what if the URI itself is never being made , that means suppose /a/b

Respond 200 with error or the response code as the error code

微笑、不失礼 提交于 2021-02-08 02:14:02
问题 So, being a developer I have a very basic question, in a REST standard we have 100's of error code for specific reason like: 4xx if resource related 5xx if exception occurred in server and many more. Now when it comes to the implementation there are situations when we return 404 directly as the response status code with the error message in the response body . With this approach there is a thing that I think a bit confusing, what if the URI itself is never being made , that means suppose /a/b

Respond 200 with error or the response code as the error code

家住魔仙堡 提交于 2021-02-08 02:13:54
问题 So, being a developer I have a very basic question, in a REST standard we have 100's of error code for specific reason like: 4xx if resource related 5xx if exception occurred in server and many more. Now when it comes to the implementation there are situations when we return 404 directly as the response status code with the error message in the response body . With this approach there is a thing that I think a bit confusing, what if the URI itself is never being made , that means suppose /a/b

Springboot doesn't let through percentage and backslash in URL

我的梦境 提交于 2021-02-07 20:37:24
问题 We got a get request that sends string characters in url, so we use path variables to receive them. Apparently there is no way that the calling service would change its method of calling backend so we need to be able to accept a url with the following unencoded characters: When percentage sign % is sent a http 400 is returned. It does go through if the two characters following % make up an UTF-encoded character Backslash is converted into a forward slash. I need it to stay backslash. I'm

How to provide texts to swagger in a properties file for spring restful service?

牧云@^-^@ 提交于 2021-02-07 20:30:52
问题 I am creating my spring restful service documentation with swagger. Sample request handler method and its documantation below. It works: @ApiOperation(value = "Returns user details", notes = "Returns a complete list of users details with a date of last modification.", response = User.class) public Response getUser(@ApiParam(name = "userName", value = "Alphanumeric login to the application", required = true) @PathParam("userName") String userName) { ... } But I want to provide text of the

How to provide texts to swagger in a properties file for spring restful service?

拥有回忆 提交于 2021-02-07 20:30:15
问题 I am creating my spring restful service documentation with swagger. Sample request handler method and its documantation below. It works: @ApiOperation(value = "Returns user details", notes = "Returns a complete list of users details with a date of last modification.", response = User.class) public Response getUser(@ApiParam(name = "userName", value = "Alphanumeric login to the application", required = true) @PathParam("userName") String userName) { ... } But I want to provide text of the

Flask-RESTful: Using GET to download a file with REST

故事扮演 提交于 2021-02-07 19:14:13
问题 I am trying to write a file sharing application that exposes a REST interface. The library I am using, Flask-RESTful only supports returning JSON by default. Obviously attempting to serve binary data over JSON is not a good idea at all. What is the most "RESTful" way of serving up binary data through a GET method? It appears possible to extend Flask-RESTful to support returning different data representations besides JSON but the documentation is scarce and I'm not sure if it's even the best

Flask-RESTful: Using GET to download a file with REST

时光总嘲笑我的痴心妄想 提交于 2021-02-07 19:12:37
问题 I am trying to write a file sharing application that exposes a REST interface. The library I am using, Flask-RESTful only supports returning JSON by default. Obviously attempting to serve binary data over JSON is not a good idea at all. What is the most "RESTful" way of serving up binary data through a GET method? It appears possible to extend Flask-RESTful to support returning different data representations besides JSON but the documentation is scarce and I'm not sure if it's even the best