How to implement HTTP basic authentication and custom request headers for video URLs in Qt app? - qt4.7

1) How to properly implement supplying authentication parameters in http request headers, some using http basic authentication headers, some custom headers, for an URL that is used as video source for video playback , in Qt 4.7 app targeted for Symbian and MeeGo?
2) Is it possible to open a video URL that requires http basic authentication or custom request headers using the Video player application that comes with the Symbian^3 and MeeGo Devices, and can this be launched from Qt 4.7 app?
Both streaming and downloading the video file cases are of interest to me.

You can use QNetworkAccessManager for this purpose:
http://doc.qt.digia.com/qt/qnetworkaccessmanager.html
It has a bunch of handy methods for making HTTP requests and receiving responses.

Related

Audio in safari

Hello developers community,
Currently I have task to create walkie talkie app,
I am using React.js,socket.io(for real time communication) & express js.
I am not able to play audio continuously which arrives from socket listener.
specifically in IOS safari.
I can play audio with static url(base64 data url) but not with dynamic base64.
Is there any way to contionuosly pass & play the audio.
I am free to adopt any other framework or protocol also. just need some guidence for create this type of application.
I tried Audio() api and also set UX flow to get user activity in website so that browser allows Audio() to play.

Is it possible to identify which client sent a HTTP request?

Is it possible to identify the client / library which sent a HTTP request?
I am trying to fetch some data via an API and it is possible to query the API via cURL and python, but when I try to use node (doesn't matter which library, axios requests, unirest, native, ...) or wget I get a proprietary error back from the backend.
Now I am wondering, if the backend is able to identify, which library I am using?
More information:
The requests are exactly the same, so no way to distinguish them
The user-agent header field is set and overwritten for all requests
I already tried to monitor the traffic in wireshark, but couldn't find any differences with the packets on HTTP layer (only the order of the header fields is different, that according to the standard this shouldn't make a difference)
It turns out that the problem was TLS fingerprinting.
See: https://httptoolkit.tech/blog/tls-fingerprinting-node-js/
Nodejs uses google V8 JS engine, V8 based http request clients will not allow you to override headers that would compromise 'web safety', so for example if you are setting "Origin, Host, Referrer" headers, node might refuse to do so. I had the same issue previously.
Un-opinionated http clients, such as the ones written in C++(curl) and python won't 'web safety' check your requests, so that is what is causing the difference in behavior.
In my case I used a C++ library that I called from javascript to make my 'unsafe' requests and the problem was solved.

ServiceStack HTTP Utils

I’ve to make a post request to a service (not implemented with ServiceStack). From the docs, please correct me if I am wrong, I have to use HTTPUtils nuget package (v. 6.0.2), but if I make a request using its extensions the service returns a 400 bad request.
The same request done using RestSharp (v.105.0) works.
However, I noticed that I had to use an old version compared to the available version of RestSharp.(nothing changes if I downgrade ServiceStack).
Could it be that the service implementation is not compatible with the latest versions of RestSharp and ServiceStack?Is it correct to use HTTPUtils for a service that I don't know if it's implemented with ServiceStack?
Does ServiceStack add some extra wrapper to the .NET framework HTTP client?
Thanks in advance
Here are the docs for ServiceStack's HTTP Utils which can be used for calling generic HTTP APIs, which are extension methods in the ServiceStack.Text NuGet package.
Receiving a 400 Bad Request response suggests that you're sending an invalid request.
Whenever you're investigating issues calling HTTP APIs you should be inspecting the HTTP Traffic with a HTTP tool like WireShark or Fiddler so you can verify that it's sending the HTTP Request you want to send, whilst Postman is a useful tool for quickly working out the HTTP Request you want to send.
If you want help with using a tool you'll need to post the C# source code you're using, the HTTP Request/Response it's sending and the HTTP Request you want to send. Typically the HTTP Response should contain information on why your request is invalid.

how to file upload from an http client to an http server?

I am trying to convert the protocol my clients and servers use in a program from ftp to http but I have no idea even where to begin with the plethora of modules that exist. should I be using the request module? http module? The act of uploading a single text file is so simple yet I cannot seem to find a straight answer.
request module is wrapper over http module...
Anyways you can use any, but point to upload is you have to set content-type header correctly, mostly it is multipart/form-data.
You should use something like POSTMAN or ADVANCE REST CLIENT(ARC) from chrome extensions and try out the request to server and with same set of headers you can use in http module.

Sending HTTP request from reactjs/flux to nodejs and sending back HTTP response

Are there are any good simple examples of sending http requests with data from reactjs/flux to nodejs and from the nodejs server sending back an HTTP response with data? I was able to do this in AngularJS with Nodejs since it had a $http service but am confused on how to do this with reactjs. Any help is appreciated.
ReactJS does not come with a http service like you have in AngularJS. That is the way they keep their Library lean.
For making http requests, you can use:
JQuery (Most advised, as its the most used library on the frontend and probably your project or theme is already using it, so no need to include any new library).
Axios, really nice implementation of the Promise API and Client side support for protecting against XSRF (plus supports IE8)
Fetch, built by Github so support is pretty good
Superagent, small, easy to use and easily extensible via plugins

Resources