12
votes
Easily download SE posts as notebooks?
Here is an approach, not battle tested, YMMV. It depends on the new body_markdown parameter in the SE API responses. From there we can use whatever MD->NB tool ...
9
votes
Accepted
Bug with Json payload with diacritics for HTTPRequest
ExportString JSON produces UTF8 encoded json string, if put as HTTPRequest body it will undergo another encoding unless you prevent it with an option:
...

Kuba♦
- 136k
9
votes
Accepted
How to import a ByteArray from GenerateHTTPResponse?
One needs to be careful and construct the HTTPResponse properly before we ask GenerateHTTPRespone to produce the final thing so ...
8
votes
Accepted
"Accept" header in HTTP request for DOI Content Negotiation
It seems you are trying to profit from DOI Content Negotiation described here.
Content negotiation allows a user to request a particular
representation of a web resource. DOI resolvers use ...
8
votes
Bug with Json payload with diacritics for HTTPRequest
I've had luck using the functions WriteRawJSONString and ReadRawJSONString from Developer ...
6
votes
How can I find what UserAgent gets attached to my URL requests?
If you have the ability to CloudDeploy functions, you can do it like so:
...
6
votes
Accepted
How to get URL request response in Mathematica?
It looks like this particular request requires you to set a header or two before it will respond the same way it does in the browser. In particular, it looks like it needs you to set the ...
6
votes
Accepted
Curl analog with URLRead/Execute?
To keep this example self-contained, we will use the HTTP introspection service at https://httpbin.org. This is a very handy site for verifying and debugging HTTP transactions.
First we will create a ...
5
votes
Accepted
Basic API Key authentication not working with URLExecute
We will generate our own Authorization header, because this API uses a slightly obtuse method. The API uses what's known as "Basic Authentication", which is ...
4
votes
Accepted
Access openai with HTTPRequest but body parameters seems not function
According to Kuba's and GustavoDelfino's comments, the solution is to make sure to send a JSON body with a proper content-type header:
...
4
votes
Accepted
How can I find what UserAgent gets attached to my URL requests?
HTTPRequest[""]["Headers"]
{"user-agent" -> "Wolfram HTTPClient 12.3"}
or
...

Kuba♦
- 136k
4
votes
Accepted
Should HTTPRequest return the same as curl in this case
The curl request is passing the arguments as a form body, but the Mathematica expression is passing query arguments in the URL. Try changing the request property ...
4
votes
Bug with Json payload with diacritics for HTTPRequest
For what it's worth, the issue is in how ExportString is handling the diacritics. We can see that it botches them, but the function being used under the hood doesn'...
3
votes
3
votes
3
votes
How can I deal with a 502 error?
Alright, I got into contact with the support for the API, and the problem was resolved on their end. Apparently, it was an error in the routers' networking configuration.
2
votes
Accepted
Cannot submit valid form in FormFunction
As @Kuba had commented, ImportString[#, "HTTPRequest"]& does not turn POST parameters to rules. So the property "FormRules", ...
2
votes
Using HTTPRequest "Method"->"PUT" with photos in AWS S3
The problem is with my content hash not matching the AWS calculated hash (as you can see in the response from AWS). I didn't figure out how to get them to match, but I found an option in the AWS ...
2
votes
Accepted
How do I execute HTTPRequest with Binary Data?
Caveat: I do not have a SalesForce account and have not tried this code against the real site. But it works against the testing site https://httpbin.org/anything.
For this example we will create ...
1
vote
Accepted
Format of api call for Open AI chat completions endpoint
To export JSON arrays you need wrap them by list or association, like
...
1
vote
How to obtain stock information from a website
I do not think it is possible as it looks like TradingView has blocked scraping so Import does not work.
You can try the inbuilt function ...
1
vote
Curl analog with URLRead/Execute?
curl is different from the built-in Curl.
curl is a command-line tool and library for transferring data with URLs.
This aks for a Mathematica built-in or a call to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
http-functions × 22web-access × 9
api × 6
import × 3
apifunction × 3
wolfram-cloud × 2
networking × 2
web × 2
string-manipulation × 1
image × 1
windows × 1
cloud-deploy × 1
html × 1
character-encoding × 1
binary × 1
json-format × 1
unicode × 1
url × 1
headers-footers × 1
webtools × 1
storage × 1
amazon-web-services × 1
applicationserver × 1