http-status

REST API - HTTP status for a partial response

最后都变了- 提交于 2021-01-29 07:23:44
问题 I encounter the following case: I have an API that allows me to retrieve a unique resource: GET myapi/resource_id If this resource does not exist, I return a 404 HTTP status code. This API also allows to retrieve several resources via the same request: GET myapi/resource_id1,resource_id2 Which HTTP status code should I send back if one of the two resources does not exist? 200 with an explanation in the JSON in an error key 206 which allows to be more explicit with an explanation in the JSON

I send some values to another url and about that

我的梦境 提交于 2019-12-20 07:41:16
问题 I send some values using spring httpClient to other url. And about that question as I know if I send name=mister age=30 values , received page get that values not http status values, right? Http status values are for sending page's not receive page's. I mean, if I send those values, receiving page gets http values. If receiving page want to get that values, I have send that values, is that right? My team manager said to me that http has request and response so, if you send some values to

Best way to concurrently check urls (for status i.e. 200,301,404) for multiple urls in database

不问归期 提交于 2019-12-08 13:09:09
问题 Here's what I'm trying to accomplish. Let's say I have 100,000 urls stored in a database and I want to check each of these for http status and store that status. I want to be able to do this concurrently in a fairly small amount of time. I was wondering what the best way(s) to do this would be. I thought about using some sort of queue with workers/consumers or some sort of evented model, but I don't really have enough experience to know what would work best in this scenario. Ideas? 回答1: Take

how to get http status value?

风流意气都作罢 提交于 2019-12-02 14:32:46
问题 first of all i asked something before and i got another question please take a look this one first I send some values to another url and about that i made a question and got an answer, and finally i have another question if like i said that above question, i send some values to other url using spring and httpclient like this, HttpClient client = HttpClientBuilder.create().build(); HttpPost post = new HttpPost("http://test.com"); post.setEntity(new UrlEncodedFormEntity(values arrayList));

Changing HTTP status message using Sinatra

陌路散爱 提交于 2019-12-01 04:11:18
问题 I'm writing a simple Sinatra app, and given a user posts a request with an specific data, I want to return an error '453' (custom error code) with a message CLIENT_ERROR, or something similar. The problem is: looking into the Sinatra documentation and doing some testing I couldn't find a way to setup the response error message, only the response status. So, if a set the Sinatra response get '/' do response.status = 453 end I get the error code right: curl -v localhost:4567 * About to connect(