Binary Data in JSON String. Something better than Base64

The JSON format natively doesn't support binary data. The binary data has to be escaped so that it can be placed into a string element (i.e. zero or more Unicode chars in double quotes using...

Creating a JSON response using Django and Python

I'm trying to convert a server side Ajax response script into a Django HttpResponse, but apparently it's not working. This is the server-side script: /* RECEIVE VALUE...

How to serialize SqlAlchemy result to JSON?

Django has some good automatic serialization of ORM models returned from DB to JSON format. How to serialize SQLAlchemy query result to JSON format? I tried jsonpickle.encode but it encodes query...

Standardized way to serialize JSON to query string?

I'm trying to build a restful API and I'm struggling on how to serialize JSON data to a HTTP query string. There are a number of mandatory and optional arguments that need to be passed in the...

Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authorization Required"

I was trying to hit the https url for google api. Using the code below but its giving some errors. but i can hitting one google api http url and its working very well without any ...

Decoding and verifying JWT token using System.IdentityModel.Tokens.Jwt

I've been using the JWT library to decode a Json Web Token, and would like to switch to Microsoft's official JWT implementation, System.IdentityModel.Tokens.Jwt. The documentation is very sparse,...

Reading JSON data in netty server

This may be a "newb" question but here it goes anyway. I am sending JSON data from netty client to netty server. But the problem i am facing is netty server is not able to access/read JSON...

Dart: convert map into query string

I have a situation where I need to turn a Map into a query String (after the first ?). For instance if I have the following map: Map json = { "email": eml, "password": passwd }; And a...

Decoding JSON using json.Unmarshal vs json.NewDecoder.Decode

I'm developing an API client where I need to encode a JSON payload on request and decode a JSON body from the response. I've read the source code from several libraries and from what I have seen,...

Fixing a malformed UTF-8 string

I've gotten a custom JSON api for my school, so I can look up homework. Let's call the result string $result. Unfortunately it seems like the UTF-8 I'm getting back is malformed. Running...

POST from Angular to Laravel not working

I have been working on a REST API that is working correctly. Through a client like Postman, I can test and see my changes, deletions, additions, etc. working as long as I encode the data with...

HTTP/1.1 422 Unprocessable Entity Error when sending data to LoopBack from Java client

I am doing an HttpPost to send data to LoopBack and get the response. I am getting an error as below from LoopBack : HTTP/1.1 422 Unprocessable Entity [X-Powered-By: Express, Vary: Origin,...

Python JSON encoder convert NaNs to null instead

I'm writing code to receive an arbitrary object (possibly nested) capable of being converted to JSON. The default behavior for Python's builtin JSON encoder is to convert NaNs to NaN, e.g....

How to display indirectly given unicode character in Swift?

In a JSON data file, I have a unicode character like this: { ”myUnicodeCharacter”: ”\\u{25a1}” } I know how to read data from JSON files. The problem occurs when it contains characters...

Convert byte string to base64-encoded string (output not being a byte string)

I was wondering if it is possible to convert a byte string which I got from reading a file to a string (so type(output) == str). All I've found on Google so far has been answers like...

How to send a base64 image in postman

Need to make a request to a api with a image encoded in base64, the request is a put, and i was trying making in the body section using the raw format and adding i.e. this json: { "picture":...

POST data from Chrome PostMan plug-in is empty in Eclipse PDT

I am trying to debug HTTP POST data sent to some AJAX PHP in Eclipse PDT and it is new to me, so I am probably making some very basic mistake. I found what seems to be an excellent Chrome browser...

Set cookies for cross origin requests

How to share cookies cross origin? More specifically, how to use the Set-Cookie header in combination with the header Access-Control-Allow-Origin? Here's an explanation of my situation: I am...

App Transport Security - Error Domain=NSURLErrorDomain Code=-1200

I have come across this 1200 error whilst building a POC and I'm really stuck as to what the actual problem is. Before you read this, I'm not looking for work arounds as I have already implemented...

python requests fails to decode utf-8 API response

I'm trying to get the response JSON from the following API endpoint https://datos.madrid.es/egob/catalogo/205026-0-cementerios.json. My code is: import requests url =...

How to dynamically change API endpoints based on the logged in user data

In my React application. I am trying to make the endpoints configurable based on the different environment such as local, development and prod. So, to achieve that, I have created a config file...

How to get additional fields in a json data in GSON

I have a JSON object which is actually a java object serialized. The JSON object is something like this { user: 'user', telephone: '123456789' } The java object's telephone field was renamed...

kubectl: get specific value from a secret in plaintext

I want to get the value of a specific field of a secret in a shell script. From the kubectl get secret documentation, it seems the standard way to get a secret returns the whole thing, in a...

isolate the output only: FFmpeg

I'm trying to isolate the value given by ffmpeg when running a command. The command is: ffmpeg -i 03.mxf -c:v copy -c:a pcm_s24le -hide_banner -nostats -af...

How to remove null values in list of objects using Circe

I'm trying to encode a list of objects using Circe, something that looks similar to: val test = Seq(MyObject("hello", None, 1, 2, None) I'm trying to parse this using Circe: test.asJson But this...

How to convert between Json and Map<String, AttributeValue> in

I want to save an object that is encoded as a Json string to DynamoDB using the AWS Java SDK 2.0. In the AWS Java SDK 1.n, it is possible to convert standard Json strings to DynamoDB...

Is there a way to serialize a map in Kotlinx-Serialization

I'm using Kotlin 1.3.10 (and bound to this version) and Kotlinx-Serialization 0.13 and I'm having trouble with serializing a map in Kotlinx-Serialization. I have the following...

TF object detection: return subset of inference payload

Problem I'm working on training and deploying an instance segmentation model using TF's object detection API. I'm able to successfully train the model, package it into a TF Serving Docker image...

swift - Save JSON data to local file

I get posts from Reddit API. I want to encode received JSON and write it to the local file. But after writing data to it, file is empty. Please advice how can I write encoded JSON data to the file...

Parsing in JS gets me a SyntaxError: JSON.parse: unexpected character

An error pop out when I try to parse a JSON object (or at least I guess it should be an object since there's "content-type": "application/json in the response's header). Here is the full error...