I have a hexadecimal color code: #FF5733 but I don't know what exact color it is. Can anyone tell me what this color is? It would be the best if you can post an image to show this color!
jeudi 23 février 2017
getting select values with flask
I'm using html tag in my website but I'm not sure how to get it to submit back to flask. Do I need a submit button? Every time I try to submit I get an error "Bad Request: The browser (or proxy) sent a request that this server could not understand."
Here's my html:
<div class="two columns">
<form name="cat" action="" method="post">
<select name="cat">
<option value="cats" >Categories</option>
<option value="soon" >starting soon</option>
<option value="football" >football</option>
<option value="baseball" >baseball</option>
<option value="basketball" >basketball</option>
<option value="hockey">hockey</option>
</select>
</form>
</div>
and here's my function that I want to get the values from:
@app.route('/search_book', methods=['GET', 'POST'])
def search_book():
if request.form['cat']:
search = request.form['cat']
print search
return render_template('book.html')
HttpClient not reaching url
I'm writing a WP8.1 app that reads and sends data through REST API. All of them work without problems excepts the "search" one.
This API works in POST and I need to send a string in Json format defining my query. If I set only few filters, the REST API takes too long to respond. Therefore the HttpResponseMessage object has no success code and it returns a "NotFound" message, even if the web API is correcly runnning.
If I try the same request via Postman it works correctly, but if I try it via SoapUi I get a "java.net.SocketTimeoutException: Read timed out" error message.
In SoapUi I managed to extend timeout in order to get a response, but my C# code keeps on not working even if I set the TimeOut property to HttpClient object.
Can someone please help me to resolve my problem? Thanks!
How to update available products in real time for a ecommerce website
We have an eCommerce application.Let's say an "ItemA" is available and the quantity is 10. Many people are trying to buy the same product. How do we manage the availability of product in the website? When do we remove the product from website. Say, around 8 people are trying to check-out "ItemA". Many might cancel later as well. What is the general strategy that companies follow in this case?
read json data and image file as multipart form data in web api 2
I want to post mutipart form data like below to WEB API 2 controller. My data will have JSON and Image file. Please help me how the c# api controller code will be for the below data.
At present I am getting error at"Request.Content.ReadAsMultipartAsync(provider);" Error message: "Unexpected end of MIME multipart stream. MIME multipart message is not complete". I could not further anything.
var uploadPath = HttpContext.Current.Server.MapPath("~/Userimage/");
Directory.CreateDirectory(uploadPath);
var provider = new MultipartFormDataStreamProvider(uploadPath);
await Request.Content.ReadAsMultipartAsync(provider);
// Files
//
foreach (MultipartFileData file in provider.FileData)
{
Debug.WriteLine(file.Headers.ContentDisposition.FileName);
Debug.WriteLine("File path: " + file.LocalFileName);
}
// Form data
//
foreach (var key in provider.FormData.AllKeys)
{
foreach (var val in provider.FormData.GetValues(key))
{
Debug.WriteLine(string.Format("{0}: {1}", key, val));
}
}
return Request.CreateResponse(HttpStatusCode.OK);
---------------------------acebdf13572468
Content-Disposition: form-data; name="modelclass"
Content-Type: application/json
{
"MessageID": 1,
"SenderID": 2,
"userType": "sample string 3",
"msgCategory": "sample string 4",
"msgContent": "sample string 5",
"msgDistributedTo": "sample string 6"
}
---------------------------acebdf13572468
Content-Disposition: form-data; name="fieldNameHere"; filename="bg4.jpg"
Content-Type: image/jpeg
<@INCLUDE C:\Users\Lenovo1\Pictures\bg4.jpg@>
---------------------------acebdf13572468--
Web language and W3School certifications
I would like to pass some web technologies certifications, and I have found nice certifications on w3school page : http://ift.tt/2lJyOrJ
I would like to know if they are good, relevant certifications.
And if someone pass them, if it is difficult.
Thanks a lot and if you know other good certifications about web techologies, please leave the link.
thanks
Web API project with MVC 4 or just HTML project
Web API: I have created 1 web API project that has all the operations from database. Web App: I want web app in mvc or simple html that will call that API.
Challenge: Sometime my API require authentication and for some data that is public no authentication required. But I want to only allow to use this API only in my application like web + mobile apps.
How can I achieve this perfectly. Or Any other better approach to make a web app with web APIs.