I want to debug my go application when I send request using curl command.
Currently my request is handled by the binary I have.
What I want that when I send request using curl command request should be handled by the code I have not by the binary.
I did not find any documentation about it, only found this thiswhich is still unanswered.
#Zoyd did you found a way to configure it?
I've made a short video of how debugging works in Gogland and how it should be configured: https://youtu.be/tT0Op-DYs4s.
In place of the Println you can have your usual api handler and then just run the curl command against your API as usual, as long as you run this with the debugging configuration.
Related
When I run a suite of tests using Cypress, I get a TON of HTTP request logs to the terminal output. I think this image best shows the issue. In it, you can see the command I run to start cypress, and that following it comes a long list of every HTTP request made during the tests.
Is there a way to hide them all?
You can add the following to cypress.json:
"morgan": false,
The logs you see are from express (a built-in server within cypress).
I am using a local install of Playground on MacOS.
I was successful to create my business network, add my model file and logic to this network and create assets and participants instances.
So now I am ready to submit my first transaction, but I get an error message in the popup window as a result to my request. The message per se is not the problem (it's about some Undefined asset), my problem is I want to debug this transaction code by producing some execution traces, using old-school printf or log message.
I tried to insert console.log(message) instructions in my transaction code but eventually I was not able to retrieve those logs traces (eg. using a command like docker logs -f composer).
Is there another way to produce logs traces? Or did I miss a config setting to defilter logs in docker logs?
Any help greatly appreciated!
Olivier.
On console logging (and seeing them in the browser Developer console), see this Stack Overflow here (hyperledger composer playground) Can you see results of console.log('something') in browser? (it also has a link to more info there
See here https://hyperledger.github.io/composer/latest/problems/diagnostics.html for more on logging / where to find debug logs.
As for setting checkpoint/breakpoints: These are set by the Editor tooling 🙂 In H/Composer, you can just use the embedded connector (eg such as TP functions) to try out / step through each breakpoint - for more info on VSCode -> https://code.visualstudio.com/docs/editor/debugging and Atom -> How do I set a breakpoint inside of atom's package? and I posted the link to diagnostics/logging above.
One quick way I used to insert breakpoints with debug messages, is to throw an exception using throw new Error(...) in the transaction method.
This shows up in the playground interface as well.
EDIT
I've openned an issue on their GitHub and it was marked as a feature request:
https://github.com/postmanlabs/postman-app-support/issues/3165
So yeah, there are no command line arguments right now.
I'm using Postman to test an ASP.NET WebAPI.
I've added Postman executable as a "browser" in Visual Studio, like this:
The problem is, it simply runs the client without browsing to the debug URL.
Is there a command line for postman.exe in which you can define the starting url?
Also, I was reading about "Newman" but it doesn't seem to be what I need.
Thanks in advance.
i'm testing some network simple process to understand better and know how to work with NTLM.
Following this (ntlm-proxy-without-password) Q&A i found hot to uthenticate my transaction via ntml using the log information of the current user.
The command is this: curl.exe -U : --proxy-ntlm --proxy myproxy.com:8080 http://www.google.com
Know i have to do the same thing using libcurl since i need to achieve that result into the application i'm developing. There is a way to do this?
Following this Q&A i found hot to
This solved like a charm
curl_easy_setopt(ctx, CURLOPT_PROXYUSERPWD, ":");
I installed dredd - API Blueprint Testing Tool and trying to test our APIary API against the implementation.
In the blueprint I have just one resource which is correctly implemented on somehost... but test fails :(
test command:
dredd apiary.apib http://somehost.de:8443/imp-endpoint
output:
Info: Beginning Dredd testing...
undefined
I tried also with more options to get more information what is undefined.. like -l verbose and some other options. But I did not get more information about the failure :(
Does anyone have experience with it? Thank you!!! :)
Answered on Github but I'll reproduce the main points here for reference:
I wasn't able to to reproduce your "undefined" problem, but there are a few issues that, when corrected, make everything work.
At the moment, the base url can't have a path in it (see #43). This is solved in #45 but hasn't yet been merged. So your command should be 'dredd apiary.apib http://somehost.de:8443/' and then '/imp-endpoint' should be a prefix on the urls.
The URI template is incorrect in your apib file. Instead of /api/V0/Resources/CarSharing/Cars?{lat}&{lng}&{radius}, it should be /imp-endpoint/api/V0/Resources/CarSharing/Cars{?lat,lng,radius}. See RFC6750 for reference.
The line-endings should be Unix style, not Windows (\n, not \n\r). When I first ran the apib you provided, I got the error: the use of carriage return(s) '\r' in source data isn't currently supported, please contact makers (this is actually enforced by the blueprint parser, see snowcrash)
Hope that helps! I get a 401 when running the test, so you'll need to provide HTTP Basic authentication information (this can be done in the header section of the blueprint or with the -u flag on dredd, as in -u username:password)