Comments (3)
IXMLHttpRequest2 is an platform API. The goal of this project isn't to test IXMLHTTPRequest2 of course since that better work since its an old platform API.
We're mocking above our platform abstraction layer (which calls platforms APIs on UWP/Xbox/iOS/Android/etc). The mocks are really for something like a game that wants to serve up fake data when in "editor" mode so they don't have to sign in to Xbox Live, etc to populate the UI.
You can see the mock API here: https://github.com/Microsoft/libHttpClient/blob/master/Include/httpClient/mock.h. It works similar to a Fiddler auto-responders in that it does patter matching and a match is found it'll use return data found in the mock you set.
from libhttpclient.
IXMLHTTPRequest2 of course since that better work since its an old platform API
If I pass new lines in my url it silently/happily removes new lines and fetches wrong url (e.g. url without newlines isn't the one I was requesting). Whatever I try to test I get issues with it.
In my case instead of mocking responses I actually implemented in c++ an http server with nodejs-style api (that is, in 3-5 lines of code I can handle simple http requests right in my code) and since server and client are in the same process I can easily tell the server what it should serve me. This way I can make it work overall as close as possible to real http requests. This is off course isn't possible with ixml2 as I need to hook dns resolution.
I thought that you tried to do similar type of mocking.
Also, only by mocking and testing I can ensure that all http backends (curl, msxml, etc) yield exactly the same results in my wrapper api. For example, two redirects followed by timeout, or failed dns resolution: all these should produce identical results regardless of backend. Overall I have very similar goals as libHttpClient
:) didn't know this project existed.
from libhttpclient.
Yeah that makes sense. Our primary tests are to ensure that the Xbox Live services respond correctly (via XSAPI) regardless of the http backend we are using.
But if you want to mock on Xbox in the pattern your doing, if you have access to the XDK, you might be able to do https://docs.microsoft.com/en-us/windows/uwp/xbox-live/using-xbox-live/troubleshooting/how-to-set-up-fiddler-for-debugging#for-xbox-one-xdk-based-projects and then instead of using Fiddler, setup a http server. Not sure. Never tried it. Alternatively I know you can use Fiddler auto-responders but its more limited than your own http server code.
from libhttpclient.
Related Issues (20)
- Android native activity sample? HOT 1
- openssl.bash hard-codes /Applications/Xcode.app HOT 1
- [Announcement] Deprecation of the Visual Studio-based Android build
- Be able to query if library has been initialized HOT 2
- How to get access to PS4 and Switch platforms? HOT 1
- No platform error message on Microsoft platforms? HOT 4
- Provide an example how to shutdown websockets safely HOT 1
- There should be a version of HCHttpCallRequestSetSSLValidation for web sockets HOT 3
- Where can I download the compiled version HOT 1
- This repo is missing important files
- libHC wedges when it can't close Websocket connection cleanly HOT 2
- HCGetWebSocketConnectResult populates result with different handle HOT 3
- close func may be executed after HCWebSocketCloseHandle returned HOT 1
- Is this library support Hololens2? HOT 8
- Integration into Vcpkg HOT 1
- No way to consume ios/osx versions from CMake
- Issue and proposed fix. Non ascii characters in header causes a IllegalArgumentException HOT 1
- networkErrorCode limitations HOT 2
- How to use with Xbox Durango XDK HOT 3
- Does the GDK libhttpclient implementation of WebSocket meet the RFC6455 standard?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libhttpclient.