hreq | User first async http client | Reactive Programming library
kandi X-RAY | hreq Summary
kandi X-RAY | hreq Summary
hreq is a user first async http client and server.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hreq
hreq Key Features
hreq Examples and Code Snippets
Community Discussions
Trending Discussions on hreq
QUESTION
I'm trying to retrieve a JSON response object through the below query API. When I try to read the responseText in VBA I receive an empty result. However, the exact same request returns correct data from PostMan. Also, the correct data returns from sending the different request bodies. Whenever I try to execute Set Json = JsonConverter.ParseJson(strResponse)
and I'm getting the error message Error Parsing JSON: ^ Expecting '{' or '['
. Can you please help?
This is VBA code
...ANSWER
Answered 2021-Sep-12 at 09:44Probably your request is wrong and you don't get the expected response because of it... Look at the status that's returned (hReq.status
and hReq.statusText
), I bet it's 400 Bad Request
or 500 Internal Error
and not 200 Ok
. (You could also use an inspecting proxy like Fiddler to look at what exactly you send and receive here.)
I can already see your request body is invalid JSON as it has unquoted strings in it... It's not the exact same as you showed in Postman! That's like the issue (or one of the issues). You have e.g. "methodType": extract
, but it has to be "methodType": "extract"
(in VBA ""methodType"": ""extract""
) - you did it correctly in Postman but wrong in your code.
QUESTION
I'm trying to use a web API with Excel VBA.
In the API instructions it is written:
Using cURL
...ANSWER
Answered 2021-Mar-16 at 09:52This is not valid hreq.setRequestHeader "-v -u {MyEmail}:{MyPassword}"
Try basic authentication instead
QUESTION
Hope somebody might able to help me. I am a real rookie in this field, had a friend of mine write up the following code some time ago. I have VB in Excel that gets data from a yahoo API, URL: "https://query2.finance.yahoo.com/v8/finance/chart/" & ticker & "?interval=1m&range=1d"
The data gets inserted in excel and is auto-refreshed every minute. Everything works smoothly with no issues. Now to the challange, since the data gets auto purged after a day in the excel, I would need to extend the amount of data (rows) from the current 1 day to 7 days. So I tried simply to change the URL from the above mentioned to the following: "https://query2.finance.yahoo.com/v8/finance/chart/" & ticker & "?interval=1m&range=7d"
However the parsing in the code gives me errors which I am to bad at solving.. First warning comes in the code: "Case Else: If token(p + 1) <> ":" Then dic.Add key, token(p)"
And the whole code is as below (feel free to try it in excel if you would like), thanks in advance.
...ANSWER
Answered 2021-Feb-25 at 16:14Problem is the parsing code cannot deal with the multiple trading periods which in the JSON are arrays within arrays [[{}],[{}],[{}]]
when the range is greater than 1 day. The array index counter e is reset at each opening bracket so you get identical keys for each trading period. Dictionary keys must be unique hence the error. The best solution would be to rewrite using a modern parser but as a quick-fix hack the ParseArr function as follows ;
QUESTION
I would like to get data from a JSON-String, which is in a JSON-Array, with VBA to display the data into an Excel-Worksheet. I'm using the library (VBA-JSON v2.3.1 JsonConverter)
I have the following JSON-Object
...ANSWER
Answered 2021-Feb-12 at 13:29The item you are returning is, itself, a json string. So to parse it out, in VBA, you need to create another json object.
eg:
QUESTION
I would like to get data from a JSON-Object, that I got from a Rest-API, with VBA to display some data into an Excel-Worksheet. I'm using the library (VBA-JSON v2.3.1 JsonConverter).
I have the following JSON-Object:
...ANSWER
Answered 2021-Feb-07 at 19:51Your "root" json object is a Dictionary - the key "devices" is a Collection object, and the first element is another dictionary with two keys "data" and "type".
"data" is another Collection of Dictionaries, so you can do this to get to the contained id
and name
values:
QUESTION
I have an application that does authentication via oauth.
...ANSWER
Answered 2020-Aug-20 at 08:55There was still an old filter class, not configured in the web.xml, but annotated with @WebFilter("/*")
.
I deleted this file and now everything works as expected.
QUESTION
I am trying to use VBA Excel to access the API provided by the website www.myfxbook.com. The API documentation is here(https://www.myfxbook.com/fr/api). The Steps to get the data are as follows:
- Login through Login API
- Get session ID of the session from response of Login API
- Get data based on this Session ID through various other APIs
- Logout through the Logout API to generate a new session
The Problem I am facing is that even though the Login and Logout APIs are being used and throwing no error, I am always getting the same Session ID when I am trying to use it through Excel VBA. On the other hand, using the same URLs through Python or even the browser is giving me a different session ID each time. i can only use Excel for this project. Could someone please help me how to get different session ID on successful logout?
I am using the code below to do this. I have hidden (*******) the Email ID and password for security purposes.
...ANSWER
Answered 2020-Jun-18 at 12:54I think it likely you are hitting caching. Try to force an avoidance of this with an additional header
QUESTION
I am working with VBA and trying to create a table from a response test using HTTP request. Here is my code:
...ANSWER
Answered 2020-Mar-05 at 21:25This loops through your header request and posts to your preferred sheet:
QUESTION
I connect to the corporate network through Cisco, and then through domain NTLM authorization to the corporate https site.
So I go through the proxy (it’s enough to log in with the password once in IE) and the program goes to all sites except the corporate one, it fails with error 12045 (ERROR_INTERNET_INVALID_CA) or 12057.
How to get a certificate from the store? Naturally, without using a username with a password and certificate name. Help, please, who knows. I tried it also through http.
Here is the function:
...ANSWER
Answered 2020-Jan-30 at 14:03Login have to be with a domain name, eg Domain\Login
The code below is working for me:
QUESTION
I have written a function, which is updating exchange rates depending on date and currency symbol - and it works well. But when I want to change some values (from PLN to, for example, USD) in my worksheet (in defined range), the loop is interputed (in bolded line). Moreover, the range where the exchange rates were saved, change to #ARG!. Below the code of function and loop:
...ANSWER
Answered 2020-Jan-07 at 19:41It looks like your function for retrieving FX rates (Function PobierzKurs
) recalculates each time your second macro converts values from Polish Zloty to USD.
As the looping process is fast, your Function sometimes doesn't have enough time to recalculate a given exchange rate, thus an error. It also explains why going through the code with a breakpoint produces the result (when manually stepping through the code, Function PobierzKurs
has enough time to recalculate the FX values).
There are two potential solutions that you can try on your side -
1) You can either add Application.Calculation = xlCalculationManual
at the very beginning of your code (the one with r.Value
) and finish it off with Application.Calculation = xlCalculationAutomatic
2) You can store the value of cell L14 in a variable (e.g. dim lngFX as Long
// lngFx = Sheets("Raport").Range("L14").Value
and then use it in your calculation: r.Value = r.Value / lngFX
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hreq
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page