Is it possible to add multiple parameters in a fetch request?
(WORKING) Request only body with a few parameters:
icFetch FETCH 1 (body[header.fields (from to subject date)])\r\n
(NOT WORKING) Request body with a few parameters and flags:
icFetch FETCH 1711:* (body[header.fields (from to subject date)]) (FLAGS (\Unseen))\r\n
Thank you!
Regards
Yep, you've got extra brackets!
You want
icFETCH 1711:* (BODY[HEADER.FIELDS (...)] FLAGS UID INTERNALDATE)
I don't think you can fetch just a specific flag like that though.
Related
I'm running a OpcUaClient.historyRead operation which returns me a HistoryResult with a continuationPoint set. The OPC UA spec tells:
When a ContinuationPoint is returned, a Client wanting the next numValuesPerNode values should call HistoryRead again with the continuationPoint set.
When looking at ReadRawModifiedDetails I cannot find any parameter for continuationPoint.
How can I submit a request containing the continuationPoint to request the missing data from the server?
As I got support on the Milo mailing list I can answer my own question. The continuationPoint can be passed to OpcUaClient.historyRead by using the nodesToRead parameter:
new HistoryReadValueId(
new NodeId(5, "Counter1"),
null,
QualifiedName.NULL_VALUE,
continuationPoint
);
I'm trying to write a http rest client for my webservice and i need to send some PATCH requestes with data in the body.
I'm using the JUST library for sending requests ( https://github.com/JustHTTP/Just )
My express application just doesn't see the request.
Here's some code (i'm testing in playground, and everything went fine with other kind of requests like put, post...)
headers = ["accept":"application/json","content-type":"application/json","authorization":"key"] //key is ok
var data = ["id":3, "quantity":6]
var r = Just.patch("http://api.marketcloud.it/v0/carts/1233", headers:headers, data:data) //1233 is a cart Id
print(r)
print(r.json)
The method Just.patch returns an HTTPResult Object.
this says 'OPTIONS http://api.marketcloud.it/v0/carts/13234 200'
Also this object should contain a json, but it's 'nil'.
On the server-side, my express applications doesn't receive the request (it just logs an 'OPTION', but nothing else).
Could this be a playground-related problem? Or a just-related one?
Thanks for any suggestion
I managed to contact the library's author via twitter and he fixed the bug and answered me in less than 24h!
Here's the new release of the library.
https://github.com/JustHTTP/Just/releases
Reference: https://developers.google.com/youtube/2.0/developers_guide_protocol_contacts#Retrieve_contacts
Note that the API returns a maximum of 100 contacts for any given contact feed request even if more contacts match the request parameters.
Question: How / Where do we define the request parameters to narrow down a long list of contacts (100+) to a short list (<=100) ?
I would expect something like an authenticated request to:
https://gdata.youtube.com/feeds/api/users/default/contacts?v=2&q=wildcard+querystring+wildcard
or
/feeds/api/users/default/contacts?v=2&fields=entry[yt:username: * da *]
and what is the wildcard (does asterics work)?
Given that the response includes the pagination info:
<openSearch:totalResults>4</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
You could page through the results. See Paging through results in the docs.
is it possible to access POST data at this (QWebPage::acceptNavigationRequest) moment? I wish to peek at request's POST data there because I locked navigation and I don't have the opportunity at NetworkAccessManager::createRequest because that it not reached.
Thanks!
Are you the one creating the request? If you're making the request, you should be able to see the POST data. If it's a webpage that you didn't create making the request, you should use another tool like Wireshark to look at the data sent to the server.
yes it is possible simply overwrite the QNetworkAccessManager::createRequest
Member to:
QNetworkReply * networkaccessman::createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData )
{if(outgoingData){
qDebug()<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%";
qDebug()<<outgoingData->peek(1000000);
}
return QNetworkAccessManager::createRequest ( op, req, outgoingData );
}
How does one change user agent strings in http requests made in R? And how do I figure out what my current user agent string looks like?
Thanks in advance.
options("HTTPUserAgent") or getOption("HTTPUserAgent") prints your current settings, and options(HTTPUserAgent="My settings") is the way to change it.
To temporary change this option use: withr::with_options:
withr::with_options(list(HTTPUserAgent="My settings"), download.file(..something..))
or Droplet answer if you use download.file.
The solution using options() in the accepted answer will change the setting globally for the whole session (unless you change it back).
To change the User-Agent temporarily in a request made by download.file(), you need to use the headers argument:
download.file("https://httpbin.org/user-agent",
destfile = "test.txt",
headers = c("User-Agent" = "My Custom User Agent"))
Since R 4.0.0, you can also use this argument in available.packages() and install.packages() and it will be forwarded to download.file().